Questions tagged [htaccess]

The most common name of the per-directory settings file for the Apache server. WordPress stores the mod_rewrite configuration for "Pretty Permalinks" here. [url-rewriting] should be used for the WordPress rewrite system in general, [mod-rewrite] when you talk specifically about the Apache module.

Filter by
Sorted by
Tagged with
1
vote
1answer
25 views

blocking access to all post/tag URIs via htaccess

I want to block all access to the post/tag/example-here pages on a WordPress site, but the following does not work. The .htaccess access file is being parsed. It is at the root of the site (ie the ...
0
votes
1answer
23 views

I want to resolve Redirect Chain [closed]

Anyone who can guide me in this matter, I want to resolve the redirect chain? http://www.example.com redirect to https://www.example.com and then redirect to https://example.com. I want to redirect ...
1
vote
2answers
25 views

Site searches by Python for non-existent assets

I've recently started paying greater attention to my 404 errors in order to clean up what I can and improve my site's SEO and ranking, and have noticed something that I don't understand. In my 404 ...
2
votes
2answers
32 views

Hacked website redirect, only on desktop, help with restoring it [closed]

This is my first post, I tried searching for similar problems, didn't find any that would fit my situation. Anyway. Recently my cousins website got hacked, I decided to take a look and try to fix it ...
1
vote
2answers
73 views

Deny access to a path (give 403 or 404 response)

I know this should be easy. BBpress creates user profiles at /forums/users/. I'd like to make them unavailable to anyone, and not be indexed by Google. I've tried the following (in .htaccess) and ...
0
votes
0answers
19 views

.htaccess to redirect to a wp page

My custom .htaccess commands are above the WP ones. This is working: <IfModule mod_rewrite.c> RewriteEngine On RewriteRule ^$ wp-content/ahoj.txt [N] </IfModule> It shows the contents of ...
0
votes
0answers
17 views

Wordpress pagination broken for page 2,3 with custom permalink. Redirects to baseurl

I have a forum installed with my Wordpress site. My pagination does not work and redirects pages 2,3, or more to baseurl when they are on homepage. Here are the settings: Forum baseurl: https://...
0
votes
1answer
31 views

Htaccess file reset automatically how to fix this issue

Often my WordPress htaccess file was reset am not able to find the root cause of this issue. But I guess this may happen when installing any plugin or manually take a complete backup of the site. Also,...
1
vote
1answer
36 views

Wordpress: Adding Security

Regarding this answer, is correct to add the file debug.log in this way? RewriteRule (?:debug|readme|license|changelog|-config|-sample)\.(?:php|md|txt|html|log?) - [R=404,NC,L] Kind Regards
1
vote
1answer
29 views

remove query arg from url after set query

i make migration plugin from specific script to wordpress, but i have a problem on redirect old urls to new one old urls is like book.php?view=12a34b56 and i want redirect it to book/12a34b56 i try to ...
4
votes
1answer
41 views

Name-based virtual host configuration in Apache seems to cause a “500 Internal Server Error”

I have the following problem: I made 10 WordPress sites for 1one client and now he needs me to configure the domains in his VPS. Based on some searches I did on the internet, the first thing I needed ...
0
votes
1answer
40 views

Clone WordPress for testing on localhost (with Fiddler)

My local setup for WordPress is at http://127.0.0.3/blog. When calling https://my.domain.name/blog/wp-login.php, I get the page served; including Google CAPTCHA. But the login post to a 302 redirect ...
0
votes
0answers
17 views

ErrorDocument 410 gives me back a 302 header

I've deleted several pages and tags from my site, and bases on my SEO recommendations I've redirected them to 410. I've done that in my .htaccess file this way: RewriteRule ^tag/lorem/?$ - [G] ...
1
vote
1answer
37 views

Redirect http to https does not work on subdir where another instance of WordPress installed

I have installed two instances of WordPress, on https://www.example.com/ and a subdirectory https://www.example.com/blogs/ Now to make all HTTP URLs be redirected to the HTTPS version, I add the ...
0
votes
0answers
22 views

PHP application in sub directory keeps redirecting to main site

I've got a PHP script which I have setup in a subdirectory (public_html/phpscript) but whenever I try to access it via www.example.com/phpscript I get redirected to the main site with a 404 page not ...
0
votes
1answer
49 views

URL rewrite for mu-plugin assets

I have a semi-bespoke scenario, but one that works best for out environment sharing the code workload and accessibility (and version control). We have a multisite that all abide by the same core ...
0
votes
0answers
29 views

Stop home page redirect to subfolder

I have a confusing issue! my home page redirect to subfolder! other pages are ok. just home page makes me confused. fidanfilm.ir .htacces on root is RewriteEngine On RewriteCond %{HTTPS} off ...
-1
votes
1answer
13 views

Comment reply href is different on production vs local

So I can reply to comments on local but it doesn't work on live. I can reply via the admin panel but when I click reply on a comment on a single page, it doesn't work. I checked the code and it seems ...
0
votes
0answers
22 views

Wordpress Multisite determine the correct domain to be set as current/default domain when setting multisite in Local fresh installation

I am unsuccessfully trying to setup multisite with Wordpress's fresh setup(Wordpress installed in subfolder under htdocs of Localhost), but existing copy of Database already imported(provided by ...
1
vote
1answer
14 views

How can I fetch the content of a post of my wordpress domain from an other domain?

I have my wordpress website, let's say wp.com, and an other domain, let's call it js.com. I would like to allow GET queries coming from the javascript client code of js.com to wp.com. Something like: ...
0
votes
1answer
29 views

How can I redirect users on the new 404 page without plugin?

I have a 404 page in my theme but I am not using that page. I have created a new 404 page in WordPress using wpbakery page builder. I need to know how can I redirect users on the new 404 page without ...
0
votes
1answer
39 views

How to fix URL with pageid example /?p= too many redirection error

I have recently updated my WordPress to 5.5 and I encountered "too many redirection error" when I use URL with page id /?p=1234 (previously it was working before the update). It keeps ...
0
votes
0answers
14 views

hide theme files for admin beneath root

The purpose is to give full admin rights, but not to the proprietary theme files. Our website is on /root/public_html/ We want to move only the themefolder /root/public_html/wp-content/themes/ beneath ...
0
votes
0answers
18 views

How do I Fix a Redirect Chain

I'm wondering how to minimize redirects and eliminate the chain from content that's being served both from https. 4 chains in total. All autooptimize cache related.
0
votes
0answers
34 views

Custom taxonomy shared across two custom post types - url rewrites

I'm using CPT-UI to create my custom post types and taxonomies. I have two post types - aulocations and uklocations these work and show up as: /au/locations/{location-names} /uk/locations/{location-...
1
vote
1answer
39 views

Remove special characters in a URL

I need a help to prevent special characters in URL & it should redirect to 404 error page, if anyone specifically entered characters. I tried a couple of ways through .htaccess but none of them ...
0
votes
0answers
12 views

Move root to subdomain and keep root

I have a pretty huge website in root folder of server and I want to move it to subdomain. The biggest issue is that I want to keep root wordpress for marketing purpose (wordpress will be stripped and ...
0
votes
0answers
16 views

Protect certain URLs from users that are not logged in

I'm trying to protect URLs like this on my website from being opened IF the user is not logged in. https://www.example.com/download/17719/ If a user tries to direct link to this and is not logged in, ...
1
vote
1answer
33 views

Fixing custom 404 pages broken by Wordpress in a subdirectory

I used Installatron to install Wordpress in a subdirectory of an existing PHP website, to add a blog to that website. My main website is administered via cPanel. Here's my website directory structure: ...
1
vote
0answers
55 views

Htaccess file isn't redirecting http sub-pages to https––they display 404 error instead, tried many solutions and none work

I installed SSL on my Google Compute Engine hosted WordPress Multisite installation, and have been having a hard time getting it working fully. Right now, the main domains for each site redirect ...
1
vote
1answer
19 views

How to redirect a page to another?

On my website, I have following url structure: example.com/test/ example.com/test/a-page example.com/test/another-page How can I redirect all of the URLS that contains /test/ right after the domain ...
1
vote
1answer
10 views

.htaccess edits

WordPress newbie here, apologies if things don't make sense. I bought a premium theme and uploaded/installed it to WordPress. Surely enough, after doing so, I found out that I was supposed to add the ...
1
vote
2answers
57 views

Call to undefined function insert_with_markers

I'm experimenting with creating a function to write code into htaccess (I understand the security issues associated). I'm currently using the function insert_with_markers() as a starting point however ...
0
votes
0answers
16 views

Redirect default pagination page to template page's pagination

How do I redirect the default pagination pages such as http://mywebsite.com/page/2 to a template page so it looks like http://mywebsite.com/articles/page/2 articles is a custom template page and not a ...
-1
votes
1answer
43 views

Where is the htaccess in wordpress.com hosting?

I am looking to upload a htaccess file or amend the existing htaccess, assuming there is one being used by WordPress. All i want to achieve is denying access to my WordPress site and allow specific ...
0
votes
1answer
410 views

Password protect directory but not files

I'm running a WP+WOO site for a client and thought that a simple way to secure the admin login area would be to password protect it. The problem is that sometimes (especially on WooCommerce pages) ...
0
votes
0answers
22 views

How To Change a Search Submit URL

how should i change this url: http://127.0.0.1/infobd/new-info/?keyword=hope To this URL http://127.0.0.1/infobd/new-info/hope using .htaccess or add_rewrite_rule it's a search submit URL on WordPress ...
0
votes
2answers
24 views

Force a 403 response to xml file in Wordpress

I'm looking to force a 403 access denied response for an xml file in a directory outside of the default Wordpress install. The url I'm trying to force the 403 response on looks like this mydomain.com/...
0
votes
2answers
27 views

How to forward all requests starting with a specific folder name to the same folder

In my Wordpress website main directory, I created a folder servers, which contains two files .htaccess & index.php. In the .htaccess file, I add those lines to redirect all requests to that folder ...
0
votes
1answer
29 views

301 redirect any RSS feed on level up url

On my site I've got RSS feeds - something like this: www.example.com/en/shipper/feed/ www.example.com/en/carrier/feed/ I want to 301 redirect all those URLs to the level up, respectively: www....
0
votes
1answer
22 views

Woocommerce posts and products links works only once and then get 404 error

Permalink to products and post of my website getting 404 error. after saving the permalink type in Setting -> Permalink page they will work correctly. But if I refresh the links they get 404 error ...
0
votes
1answer
15 views

How do I write a subdomain redirect?

I'm trying to write a redirect so that anyone who tries visiting "www.example.au" is directed to "www.example.com", but I'm not sure how to do that in my .htaccess file. So far, I'...
1
vote
1answer
74 views

Wordpress rewrite rules don't need ^?

For example this code class My_Sitemap { public static function install() { add_filter('rewrite_rules_array', array(__CLASS__, 'rewriteRules'), 1, 1); global $wp_rewrite; ...
0
votes
0answers
11 views

Pages from admin dasboard missing after site migration

i migrated a site which was hosted on wp-engine to my local machine, after the migration in the admin dashboard i saw most of the pages are missing. on the wp-engine server, there are 59 pages, but ...
0
votes
1answer
34 views

Understanding Redirects

I have a WordPress website that is working well. The website is shared hosted on a popular hosting site. It was migrated/transferred from a different hosting site to the current one (this point is ...
0
votes
0answers
28 views

Adding a page to custom post type hierarchy?

My custom post type has the URL Structure "/work/post-name" The default archive is disabled with "'has_archive' => false" and replaced by a WordPress Page called "/work/&...
0
votes
0answers
23 views

multisite 404 subfolder same name slug as site

To keep this short, as a disclaimer, I'm not that versed with WordPress, servers, etc, so I might talk gibberish: The Issue 🠺 I have a multisite root, let's call it msite.com 🠺 This site spawns ...
1
vote
0answers
14 views

“View post” leads to odd URL

On one of my sites, pressing "View post" from the back-end creates an odd URL, always taking the user to the homepage. The correct URL shows when you mouse-over the link - for example - www.trunk....
2
votes
0answers
44 views

Create subdomain masking for each user in WordPress

I am trying to add subdomain URL for each user. For eg: if my site has a user name as John then the URL which he will be sharing with his users is http://john.example.com and this should open the ...
0
votes
0answers
10 views

Trying to load the site via domain but automatically redirects to IP

I have moved a site which was developed in localhost to a new web host with a new domain. I updated the site_url and home_url in the wp_options table. I put a basic .htaccess file to the webroot. But ...

1
2 3 4 5
24