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.

458 questions with no upvoted or accepted answers
Filter by
Sorted by
Tagged with
4
votes
1answer
1k views

Site redirects to wrong url when saving settings

I have a subdomain: https://blog.example.com/ I forcibly redirects to subdirectory: https://www.example.com/blog By changing site URL and some RewriteRule on .htaccess. Now the website and admin ...
4
votes
3answers
3k views

Use subdomain for certain urls

I have the following rules in my .htaccess file on a WordPress (single installation): # REWRITE FORUMS DOMAIN TO FOLDER RewriteCond %{HTTP_HOST} ^forums\.example\.com$ RewriteRule !^forums/? forums%{...
4
votes
2answers
2k views

Wordpress multisite subdirectory redirect infinite loop issue

Any time I create a new site on my multisite install, I get an infinite loop redirect when navigating to that site's admin. I'm using the default htaccess supplied by WP for my subdirectory install. ...
4
votes
3answers
2k views

Static raw HTML page

On the server there is a static HTML page example.html in my root folder of the WordPress install. Now when a user types www.example.com/example.html I want WordPress to be smart and bypass all normal ...
4
votes
2answers
961 views

Old blog/ and blog/feed/ URLs not working after moving blog to top-level via .htaccess

For a long time I served my blog from http://www.murrayc.com/blog/, with the wordpress installation in /home/murrayc/murrayc.com/blog/. Now I've moved it to http://www.murrayc.com/, without moving the ...
4
votes
0answers
597 views

WordPress + Magento .htaccess ReWriteRule Issue (www vs. non-www)

I have an issue I've been facing for a bit now. Moved away from it, but now I'm back and just have no idea after trying to find a solution online. It seems individuals have faced similar issues, but ...
4
votes
2answers
1k views

How to remove “admin.php?page=” from wp-admin using .htaccess?

I'm looking to use .htaccess to rewrite admin page URLs. I'd like to change it from: http://example.com/wp-admin/admin.php?page=whatever&id=5&var=10 to http://example.com/wp-admin/whatever?...
3
votes
2answers
3k views

404/500 error on /wp-json

I get 500 error on wp-json. if I try to echo get_rest_url() I get example.com/wp-json, which then gives me error 500. I added RewriteCond %{REQUEST_URI} !^/wp-json to my .htaccess, which gave me 404 ...
3
votes
1answer
245 views

Wordpress keeps deleting .htaccess file

Recently my wordpress site has been experiencing problems with all pages returning a 404 error. I tracked this down to the fact the .htaccess file in my wordpress directory keeps disappearing. When ...
3
votes
2answers
531 views

Cache Busting using htaccess Rewrite rule?

I am trying to follow this tutorial that says i can make a server to send a file like style.css if the requested file is style.15458888.css with a rewrite rule to be put inside the htaccess file. ...
3
votes
1answer
4k views

Multisite Subdomains result in 403 Forbidden

So I have setup multisite as per the WordPress website page: https://codex.wordpress.org/Create_A_Network I'm using the latest WordPress 4.8. Setup example.com sub.example.com All requests for ...
3
votes
0answers
594 views

WordPress URL/Folder ReWrite using Htaccess

I am trying to mask certain folder in a WordPress installation using the Htaccess file. I am aware that there are plugins available to do exactly what I want but, I do not want to add even more ...
3
votes
0answers
31 views

WordPress trims off the forward slash when import

I have an XML file with some posts to import to WordPress But, when I import, it seems that WordPress takes off the forward slash from the permalink, so instead of showing the address like this: ...
3
votes
1answer
172 views

WordPress Multisite - Multiple subfolders for blogs

I created a network in blog.animals.com, the network is running fine. I can set up blogs like blog.animals.com/chimpanse. This is also working. I like to have multiple (2) subdirectories for each blog,...
3
votes
1answer
187 views

WordPress Multisite Login Access

I have a multisite installation and use an .htaccess directive to close access to wp-login.php. <files wp-login.php> errordocument 403 http://example.com/restricted/ order deny,allow deny from ...
3
votes
3answers
39k views

Forbidden 403 error, permission to access, unable to read htaccess

Recently clean-installed (with exception of themes and content/upload folders) an old wordpress to the latest Wordpress 4.2.2. I continue to get this error below whenever I load files such as style....
3
votes
1answer
3k views

Getting a 500 internal server error ONLY on wp-admin/options-permalink.php

I have access to the admin panel, and everything works fine. I can click settings->reading and change anything I want to. But if I click settings->permalinks I get a 500 internal server error. Here's ...
3
votes
1answer
2k views

Correct htaccess to display page while also passing in GET parameters

I have a wordpress page named: directory (it uses a custom template). When I call the page with: http://localhost:8888/wordpress/directory/?segments=listings/list It gives me the results I need....
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 ...
2
votes
1answer
279 views

How disable SSL redirect for specific URL?

I have a specific URL that has to be accessible without SSL, so that some old devices can access it. The reason is those old devices have the URL hardcoded. The URL is http://domain.com/server My ....
2
votes
0answers
169 views

Why does multisite bypass WordPress for wp-content, wp-admin, wp-includes and .php files?

When you set up WordPress to use multisite, you're directed to modify your .htaccess file to use one of the following, which are outlined in the admin and the WordPress documentation: Subfolder ... ...
2
votes
1answer
710 views

Redirect from different port to subdomain - htaccess

I created a Digital Ocean instance to install WordPress website 5 days ago. I already have my own domain, and created DNS Subdomain blog.example.com. The server runs both nginx and apache so my Apache ...
2
votes
1answer
569 views

Specific URL has 403 Forbidden status code

I'm debugging a Belgian WP website: slotenmakerbelgie.com. The problem is that I get a forbidden status on a specific URL: slotenmakerbelgie.com/error/ (with and without trailing slash at the end) I ...
2
votes
3answers
356 views

Cannot mask WordPress page URL using .htaccess

.htaccess: <IfModule mod_rewrite.c> RewriteEngine On RewriteBase /wp_test/ RewriteRule ^index\.php$ - [L] RewriteRule ^the_image$ wp-content/uploads/2019/01/banner\.jpg [L] RewriteRule ^...
2
votes
0answers
68 views

Alias 'wp-content' directory to something shorter (framework?)

I recall seeing this as a feature of a Wordpress Development Framework, so I know it's possible (can't remember the framework). I am interested in how to condense the Wordpress-generated urls to ...
2
votes
2answers
2k views

How to append a URL parameter to all outbound URLs

Is it possible to append ?ref=myref to all external URLs? If so I'm guessing I will also need to check if a ? already exists and use & if so. I'm a WP noob just coming from Joomla, any tips / ...
2
votes
1answer
319 views

Wordpress .htaccess - route other URLs to another app

I need help in WordPress .htaccess. My projects name is Project this is WordPress and onepage website, inside this I have one more project that is built in CI named app. What I want is, if someone ...
2
votes
0answers
80 views

Passing parameters to Wordpress static front page

I have a custom plugin that shows a series of custom posts on a page, i.e. http://www.example.com/permalink/ On that page I have a form to filter the posts according to a number of different ...
2
votes
0answers
121 views

CDN + WP Admin Query - .htaccess redirection

Say I have a website at https://www.example.com and I am using a CDN. Now if I want the CDN URL to be https://www.example.com/assets/... and not https://assets.example.com, then what should I do? Is ...
2
votes
0answers
87 views

Suppress subdirectory from Wordpress Multisite primary URL

I just installed WordPress Multisite (version 4.7.2) in a subdirectory of my primary domain (site1.com/wordpress), and I've configured multisite to use subdirectories for all other sites. I ...
2
votes
0answers
151 views

Rewrite my default post URL

I want to have this URL structure for my default post type : domain.com/blog/{post_ID}.php For other pages and post, I want a classic URL like : domain.com/page/sub-page/sub-sub-page/... In the ...
2
votes
0answers
55 views

Map alt domain to specific section of website w/o MU

I have one website on which I want to use multiple domain names. The URL pattern on the existing looks like this: Main domain: - shop.com - shop.com/products - shop.com/...
2
votes
1answer
41 views

.htaccess rewrite rule puzzle

Because I need to password protect a subdirectory using cPanel, I modified Wordpress's .htaccess rule as instructed here: https://wordpress.org/support/topic/password-protect-a-directory-with-htaccess ...
2
votes
1answer
3k views

Remove Parent Category from Child Category URL

I am trying to remove parent category from the child category but each attempt returns a 404 error. Main Category Link (Displays All India Recruitment) Child Category Link (Displays Sub-Category) ...
2
votes
3answers
563 views

Attach to wp-login.php and xmlrpc.php

I am receiving many requests to my wp-login.php and xmlrpc file, now I just set up an htaccess to prevent requests to xmlrpc, but how do you suggest me to block wp-login? thanks
2
votes
0answers
190 views

From 403 error to 500 internal server error

I'm trying to install wordpress on a shared hosting (1and1), it's been 3 days i'm struggling and i give up, i've installed wordpress many times on other servers with no problem, first time on (1and1) ...
2
votes
1answer
1k views

How to properly force https and www on multisite

I have a wordpress multisite in network mode via wp multi network plugin. I've been trying to use .htaccess rules to force all urls to be https://www. eg: https://domain.com to https://www.domain....
2
votes
0answers
25 views

Dissolve Multisite while making site #5 the main site?

I have a very unique situation, I was also unable to find a solution, but perhaps someone else has experienced something like this before. A client of mine has a multisite set up, however they now ...
2
votes
2answers
1k views

Question with loading 403/ 404 error pages and htaccess

I uploaded an html 403 and 404 page to my WordPress theme directory and if I hit a random mistake after .com such as .com/yyyy then it loads the 404 page for example - so all is good... However...I ...
2
votes
2answers
2k views

Why wordpress multisite redirect to wp-signup if site exists?

I just create a site on my Multisite domain (example.com), for instance site1.example.com After this, I try to enter on https://site1.example.com/wp-admin, but I'm redirected to https://www.example....
2
votes
3answers
7k views

Redirect too many times htacces switching to https

When I change the redirect https in my .htaccess the site returns the message "Too many redirects" loop. This is the modified .htaccess RewriteCond %{HTTPS} off RewriteRule (.*)$ https://www....
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 ...
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
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....
1
vote
0answers
19 views

want to rewrite an URL in wordpress

i want rewrite some urls in wordpress from http://localhost/wordpress/my-page/2/ to http://localhost/wordpress/my-page/part-2/ anyone can help? Now i am using something like this but it not working....
1
vote
2answers
45 views

redirect the homepage using .htaccess outside of WordPress

For a marketing reason, my client needs a standalone HTML Page as the "temporary homepage" What I would like to do is redirect the homepage to a page OUTSIDE of the WordPress ecosystem - I guess ...
1
vote
1answer
25 views

Giving to wordpress it's own directory cause login loop

I have done a fresh wordpress installation from a subdirectory. I've followed the official wordpress guide to give wordpress it's own directory, but now I have a login loop problem, I'm not able to ...
1
vote
0answers
8 views

Redirect all requested url to new url

i want to redirect all requested url in wordpress to new url, for example : domain.com/c/camera to domain.com/product-category/camera How can I do this in htaccess?
1
vote
0answers
11 views

301 redirection editing .htaccess doesn't work

I set up SSL certificate and submitted to the hosting service. It says it is connected to Port. I wanted to redirect http url to https, so I edited .htaccess file with a code as below in the root ...
1
vote
1answer
28 views

Can't upload .htaccess after editing in notepad

Switching site from http to https, but in .htaccess I can't upload file successfully after adding RewriteEngine On RewriteCond %{HTTPS} !=on RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=...

1
2 3 4 5
10