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
22 views

htaccess - RewriteRule without redirect not working

I had to create 3 page templates to display some content retrieved from different webservices outside of Wordpress. The templates are: page-collections.php page-collection.php page-productDetail.php ...
1
vote
1answer
8 views

I need to redirect an entire subdirectory in WordPress to the homepage - is this correct?

To redirect ALL the pages within a subdirectory I can use this .htaccess rule: RewriteRule ^subfolder http://www.example.com/ [R=301,L] My question is: can I simply use this exactly as prescribed? ...
0
votes
0answers
34 views

Internal server error 500 [closed]

On several moments users get a 500 internal server error after switching a language. It seems that the .htaccess will be overwritten every time with a . /nl/index.php [L] directory. I contact the ...
1
vote
0answers
23 views

sitemap contains weird links and does not contain my pages [closed]

I was about to submit my wordpress auto-generated sitemap to Google Search Console but I realized my sitemap contains weird links and it doesnt contain any of my actual pages. I checked example.com/...
2
votes
1answer
42 views

Only expose routes with prefix /wp-json on WordPress using Apache

Pretty straightforward: I want to only expose routes with the /wp-json prefix so that I can use headless WordPress without exposing the rest of my WordPress site to the internet. I'm running this on ...
2
votes
2answers
43 views

Keep getting 401 error from WordPress on AWS Lightsail

I'm trying to post to a WordPress server on an AWS Lightsail instance using node-wpapi. However, the server returns a 401 error. I already have a .htaccess file with RewriteRule .* - [E=REMOTE_USER:%{...
0
votes
0answers
14 views

Block IPs in htaccess on specific WP page?

I have a special WP page and I want to block some IPs (ahrefs bot and other backlink checkers) in htaccess. Lets say the page is mysite.com/special/ I only want to deny access to that special page to ...
2
votes
1answer
52 views

Changed permalink structure. Need help with redirecting old posts

I just changed the urls structure of my site and want old urls to be forward to the new without the use of redirection plugin. Old structure: /%category%/%year%/%day%/%postname%/ New: /%postname%/ ...
0
votes
0answers
29 views

Use a 301 to Redirect any 404 from at the blog post level to the blog archive

In the .htaccess file, I am trying to write a 301 to catch any broken blog page links to redirect to the blog archive page? so something like Redirect 301 /blog-archive/category/{any 404} /blog-...
1
vote
0answers
14 views

.htaccess rewriting old RSS feed URL to WordPress feed URL

I migrated my old site to WordPress, and I tought rewriting old RSS URL will be easy. Nope. My old RSS feed was served on /rss.php URL. So I added to .htaccess: RewriteBase / RewriteRule ^rss\.php$ /...
2
votes
3answers
390 views

Using “wordpress_logged_in” to restrict direct access to uploads folder in 2021

I am looking at ways to restrict direct access to the Wordpress Uploads folder. I've read a handful of Stackoverflow and blog posts about using "wordpress_logged_in" in .htaccess to check if ...
0
votes
0answers
16 views

How can I make a plugin that will add entry to htaccess?

I have a personal wordpress plugin that includes various security fixes with php snippets. I want to add a feature in the plugin which is in short- I will active the plugin and the plugin will add ...
1
vote
1answer
85 views

Corrupt .htaccess file

My site was running well last summer. But today when I tried to make updates in the wp-admin section, I got lots of 403 errors on all PHP files: load-styles, load-scripts, edit.php, media-new.php, etc....
1
vote
1answer
37 views

Adding rewrite rules directly to .htaccess file

I wanna add a simple rewrite rule RewriteRule ^apply\/? https://docs.google.com/forms/d/e/1FAIpQLSf5IrOhg0E_NAGZnOvMuaXhU80sio8bukaWVBkb87eEOa9kTw/viewform [L] my .htaccess file is like # BEGIN ...
0
votes
0answers
17 views

How to set up MS Exchange Autodiscover alongside Wordpress

My client's IT person has thrown up a flag regarding their need to use MS Exchange Autodiscover service, and that potential issues may possibly arise (ie as a result of sharing the domain with the ...
1
vote
1answer
23 views

Only plain permalinks working

I've a problem with a site (part of a multisite structure). All of a sudden all the static pages are showing the list with the last posts, except for the homepage. The single posts are working fine. ...
0
votes
0answers
21 views

Show the redirect URL in the adress bar

I'd like to know if it's possible to show the redirect URL in the address bar above? Currently, my website is live on https://www.example.nl/ and when you enter www.example.ch it redirects you to ...
0
votes
0answers
29 views

How do you remove the “The Link You Followed Has Expired” error for a subfolder website?

I am building a wordpress website in a subfolder of a drupal website. I want to add a new theme by uploading a theme file but I keep getting the “The Link You Followed Has Expired” error. From my ...
1
vote
1answer
24 views

Redirect homepage with htaccess, except if I enter the link adding “/home”

I'm trying to do something specific here, that may be a little complicated and I can't figure out how to do it. This is what I have with htaccess: RewriteOptions inherit RewriteCond %{HTTP_HOST} ^...
0
votes
0answers
42 views

Rewriting subfolders to specific parent folder in Wordpress

I have created one page with name /parent/ and assigned new template template-parent.php that has some 3rd party software showing via JavaScript. I need to rewrite all subfolders to this parent so ...
1
vote
1answer
35 views

Redirect subdomain in Multisite installation?

One of my clients has a Wordpress site that is a multisite installation. They are running a new campaign that I have set up as a page under the main site at example.com/summer/. However, they sent ...
0
votes
2answers
25 views

How to rename custom taxonomy URL with extra words

There are 2000 Custom Taxonomies, called tax_city in my website https://www.example.com/tax_city/london and I want to change URL to something like this: https://www.example.com/services/home-care/...
1
vote
0answers
53 views

503 Service Unavailable error was encountered

When I try to upgrade PHP to version 7.4 or 7.3, I get the following error: Service Unavailable The server is temporarily unable to service your request due to maintenance downtime or capacity ...
0
votes
1answer
33 views

Redirect htaccess [closed]

I need to help with redirect my page. For example I have websites https://example.com. I need to move content from https://example.com to https://example.com/blog. That is not problem and I do that ...
1
vote
1answer
23 views

AWS Wordpress Install - pages/posts 404 on restart until updating permalinks

I have launched a WordPress instance on AWS using elastic beanstalk. Every now and then AWS restarts my server and when it does all my pages/posts links switch to returning 404. I can fix this by ...
0
votes
0answers
31 views

Azure WordPress deny access to xmlrpc

I am trying to disable xmlrpc.php by using a plugin and also by using .htaccess. But it doesn't seem to be working, when I hit example.com/xmlrpc.php I still get the following: XML-RPC server accepts ...
0
votes
0answers
19 views

Sub domain URL slash / missing after domain and before Post & page slug

WordPress page/page is not working after moved the file to subdirectory. URL structure domain.com/subdirectory/post1 is loading as domain.com/subdirectorypost1 - slash (/) is missing before post/page ...
1
vote
1answer
77 views

browser caching not disabled after disabling in .htaccess

I am having a strange problem in one of my wordpress websites. The problem is that when a webpage is rendered once, editing that page won't be effected afterwards. So no matter how many times you ...
0
votes
3answers
22 views

wp-admin going directly to 404

Recently, I was having an issue with all wp-admin pages. I was able to login and see the dashboard, but every time I went to another admin page I would get a 404. So after some searching, I started ...
0
votes
0answers
20 views

Using .htaccess for temporary redirects while updating live site

Apparently there are nocache rules that can be added to .htaccess for temporary redirects, such as while updating a live WP site. In researching a difficulty with my browser getting "stuck" ...
0
votes
0answers
19 views

Capturing variable after slash in domain

I'm developing an ecommerce website with Wordpress / Shopify API. I'd like to be able to capture discount codes through the URL. So if the discount code was code40, I'd like the enduser to be able to ...
0
votes
0answers
30 views

Problem with Wordpress permalinks

We have set our permalinks so that it displays like this: example.com/iphones/ for categories and example.com/iphones/iphone-11-Pro for the products. The problem that the old native URLs of ...
2
votes
1answer
25 views

Redirect “any page/page/number/” to “any page”

I've read so many similar topics but none of them matches my own request. I'd like to redirect in ht.access any page with pagination to the root-main-original page. example.com/garden/page/2 ...
1
vote
1answer
29 views

Double domain name in category URL-s

My site runs on the latest version of WordPress. However, I have a problem with categories. Permalinks are set correctly and my category path looks like this: example.com/category-name. Links work ...
0
votes
1answer
59 views

Redirect specific URL before other redirects take place in .htaccess?

The canonical website URL will be https://www.example.com Typically any requests eg for https://example.com will be redirected to https://www.example.com by WordPress site settings. However, I have a ...
2
votes
1answer
73 views

How to exclude a directory from WordPress permalinks in a Multisite environment?

The scenario is as follows: A multisite install with three sites: site1.com (admin) site2.com site3.com Q: How to exclude a folder located in the root directory, which should also be associated with ...
1
vote
1answer
102 views

htaccess redirect - replace special character

In my previous post, I asked about how to 301 redirect all .com/language/X URLs to .com/members/?members_search=X using htaccess. Thankfully I got help, and the solution was RewriteRule ^language/(.*)...
0
votes
0answers
15 views

whenever I am visiting to subdomain it keeps redirecting to Main domain

I have created a Subdomain and installed wordpress on it, I have also deleted .htaccess file from subdomain directory. but it keeps redirecting to main domain. i have also added these line to Wp-...
2
votes
0answers
148 views

Block only external access to wp-cron.php on OpenLiteSpeed

I use OpenLitespeed server with multiple Wordpress installation and want to restrict external access to some files, only allowing server itself to access them (for example to call cron), so: What I ...
1
vote
1answer
44 views

htaccess redirect not working

I'd like to 301 redirect all .com/language/X URLs to .com/members/?members_search=X. Test case: http://example.com/language/french should 301 redirect to http://example.com/members/?members_search=...
1
vote
1answer
134 views

.htaccess rules for blocking bots with an extra condition

I have a WP multisite installed. I am integrated with Ezoic and Cloudflare. I had implemented firewall rules. However, I have an issue blocking bots that have X-Middleton in the User-Agent, because my ...
0
votes
0answers
20 views

Mysterious site access error

I'm a bit stumped because of a weird access problem of a WordPress site. The site is on the main corporate domain, and recently, the client has had office365/active directory installed for his network....
2
votes
2answers
34 views

.htaccess redirects disappeared after re-saving permalinks

I want my WordPress website to load with https + non-www and without trailing slashes. I put the following code in .htaccess file: <IfModule mod_rewrite.c> RewriteEngine On # Remove trailing ...
1
vote
1answer
17 views

Access files at new location using old file paths

I have a bunch of posts that contain images with urls that follow this pattern: https://example.com/example_directory/files/2019/04/file.png I've imported the posts into a new install of wordpress on ...
1
vote
2answers
265 views

When is it necessary to have Header unset Vary in .htaccess

I just did a major update in my WordPress environment tonight to the latest version, and got an internal server error on the site. I then did a full inspection to see where the issue was coming from. ...
1
vote
1answer
45 views

SSL and www to non-www redirection works only on homepage - Wordpress

I've enabled SSL on my Wordpress website and set redirection from www to non-WWW via the following code placed in .htaccess: # REDIRECT WWW TO NON-WWW RewriteEngine on RewriteCond %{HTTP_HOST} ^www\....
1
vote
1answer
115 views

How to remove wordpress directory slash

I have installed a website in my domain directory like example.com/website. The main issue or problem is that it redirects me to example.com/website/. I never want redirection and I just want that my ...
1
vote
0answers
19 views

Wrong Redirect/Rewrite Rules?

i'm a total newbie to rewrite and redirect rules and i have some strange problems on my multisite. when i try to open www.my-website.com/blog or www.my-website.com/xmas for example, in safari browser ...
0
votes
1answer
81 views

Strange behavior: random HTTP error 500 fixed by visiting Permalinks settings page (htaccess issue with language code)

I’ve got a pretty weird behavior on my site that I’d like to resolve. From time to time (no recognized pattern), my site shows a 500 error, on the front pages or on some admin pages. When this 500 ...
1
vote
1answer
52 views

Remove / from www.example.com/ [closed]

Whenever I type my domain, example: www.example.com there is a forward slash that automatically appears in Firefox. Example: www.example.com/ How can I remove this?

1
2 3 4 5
26