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
4
votes
2answers
3k views

Wrong canonical link on wp-admin pages

I have a subdomain: https://blog.example.com/ I forcibly redirects to directory: https://www.example.com/blog By changing site URL and some RewriteRule on .htaccess. My .htaccess: <...
0
votes
1answer
23 views

Wordpress is adding "category" word before my actual category name in url (and this is unsolicited)

Check out this image: This is twenty twenty theme, a default theme. I started facing the problem with a non-default theme, so I switched over to this other theme just for testing, same thing. What's ...
0
votes
1answer
1k views

Stop forcing certain paths to end with a forward slash

As far as I understand, WordPress prefers a trailing slash at the end of your URL. However, it applies this rule also to https://example.com/amp, so I get a 301 Redirect to https://example.com/amp/. ...
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 ...
-1
votes
0answers
15 views

@fontface for adding custom font is not working for WordPress

i am struggling since two days to add a custom font to Wordpress (Apercu regular and Apercu bold). web address: https://www.auramonaco.de Theme: Savoy What i did: Uploaded the fonts to savoy-child/...
0
votes
0answers
23 views

Add a parameter at the end of the url and prettify

I have created a plugin with a shortcode that renders the results to a list of items. The plugin is programmed in Vuejs so the shortcode does not have any type of parameter. The fact is that I go to ...
5
votes
2answers
988 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 ...
1
vote
1answer
624 views

Redirect all posts permalinks from ".html" to "/"

How can I redirect all posts permalinks from .html to / in WordPress? To be more clear, for example, a post URL like this: http://example.com/%category%/%postname%.html To be redirected to: http:/...
1
vote
2answers
228 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
18 views

set up 301 redirect within wp-content/uploads/ directory of a WP site to a new image URL

I need to do a redirect within wp-content/uploads/ - to a new image name, because the old one doesn't work. How do you do this? I want to redirect from https://example.com/wp-content/uploads/2021/09/...
1
vote
1answer
1k views

Multisite Redirection to new domains

I have a multisite website with 5 domains in WordPress which uses WordPress MU Domain Mapping plugin. I want to redirect every subpage to new domain, but we will be still using the homepage, because ...
8
votes
6answers
10k views

WordPress site hacked. Has .htaccess been hacked?

I'm trying to clean up a WordPress website that's been hacked. I noticed that the .htaccess file has some suspect looking regular expressions, but my regex skills are pretty weak (time to learn I ...
1
vote
1answer
16 views

add_rewrite_rule fro html to another url not working

I want to redirect mywebsite.com/anyname.html to mywebsite.com/product/anyname For that I write the following query in functions.php . But it is not working . Please see my code below function ...
1
vote
1answer
8k views

subdirectory index.php is not working

I have setup wordpress in the root directory and at the same level I have some other directories e.g named "sq". Under sq there are subdirectories like first, second, ... under each subdirectory ...
0
votes
1answer
610 views

Change wp-login.php? Problem with .htaccess password protection and multi user shop

I use a .htaccess password protection to secure my wp-login.php. For me as the admin of the WP/WooCommerce installation everything works fine so far (my password manager helps me to remember the tons ...
0
votes
1answer
2k views

Pagination redirect set in .htaccess file is not working

I'm trying to redirect like below but it's not working. http://example.com/page/2 -> http://example.com/item/page/2 Below is the source of .htaccess file: RewriteEngine On RewriteCond %{...
4
votes
1answer
5k 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 ...
2
votes
3answers
654 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
1
vote
0answers
678 views

Some PDF files get Forbidden Access and other open normally on the same directory subsites

I have a WordPress multi-site with 4 subdomains. All PDFs in the main domain site work fine while on subdomain I get Forbidden access for certain PDFs. For instance when I open: http://example.com/...
3
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....
0
votes
0answers
11 views

How to Leverage Browser Caching for Fonts in WordPress [migrated]

I am using WordPress along with Autoptimize and Cloudflare, and using Locally hosted fonts. I can't leverage browser caching on my site. I tried using Cloudflare Page rules to Leverage 1 year browser ...
4
votes
1answer
2k 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 ...
0
votes
1answer
723 views

Duplicate WordPress site to subdirectory but use same db?

I have tried to just copy the whole root folder into a subdirectory. I understand the .htaccess file has to be changed. But can't get it to work right. Is it something more than changing the htaccess ...
1
vote
4answers
2k views

Redirect - remove custom query string

I have a problem with some page URLs. The page URL structure is like this: www.example.com/wp/custom-taxonomy/somepagename/?token=12345 I want that when I access the URL above to redirect me to: www....
2
votes
1answer
585 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 ...
2
votes
0answers
39 views

Giving WordPress its own subdirectory - nginx

I want to move WordPress installation to a subdirectory without affecting site url - https://wordpress.org/support/article/giving-wordpress-its-own-directory/ (method 1) The article contains only ...
1
vote
1answer
28 views

Redirect parent taxonomy to it's child

I am trying to redirect this url/investments/state/city/ to this url/investments/city/ custom post investments taxonomy structure: state 1 city 1 city 2 and so on. Any elegant solution?
1
vote
2answers
3k views

Exclude subfolder from WP-redirect works with html but not php files

I want a certain subfolder excluded from being handled by WP with its 404 - page not found message. My problem is: example.com/Non_WP/myfile.html - shows correctly but example.com/Non_WP/myfile....
3
votes
1answer
981 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 ...
1
vote
2answers
693 views

Rewriting a subdomain page on one WordPress installation to a parent domain on another

How can I use .htaccess to rewrite a a page on a subdomain to a page on the parent? (E.g. people visiting mysite.com/landingpage will see the content from dev.mysite.com/landingpage)? Ive been ...
1
vote
1answer
3k views

301 Redirect all page and post urls from .html to /

I have a current site where all URLs end with .html. I created a new site and the URLs are pretty much the same but without .html. I've been trying codes found here in my .htaccess file and most ...
7
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%{...
1
vote
1answer
91 views

How To Allow Only Specific User Agent To Access a URL?

Suppose this is my URL: https://www.mrskt.com/sitemap_index.xml I want to only allow specific user agents. I mean only search bots like Google, Bing, Ahrefs, etc. can access that URL. No other user ...
0
votes
1answer
571 views

Unable leverage Browser Caching on AWS Bitnami stack (Apache) through W3TC and Cloudfront CDN

I followed many tutorial about leveraging browser caching nevertheless I couldn't configure it succesfully, in fact GTmetric (PageSpeed and YSlow) notified me many static file that don't have a cache ...
1
vote
0answers
16 views

www redirects to another directory in wordpress

I am using Really Simple SSL plugin but I just noticed that whenever I type the www.ozaro.com/mozaro it automatically redirects to ozaro.com not ozaro.com/mozaro So please help
0
votes
2answers
781 views

Can't access 2nd site (sub) dashboard of Wordpress Multisite

I can't access the dashboard of the second site. When I go to the second site, I only see the HTML page without the style (css). When I try to access the dashboard (from Safari), I get this message ...
1
vote
2answers
49 views

Point all URLs to homepage but maintain URL

I would like my website to point any URL website.com/about/ website.com/about/more/ to the homepage. However, I would also like to maintain the URL in the browser URL bar. How can I achieve this? A ...
2
votes
1answer
24 views

How to create a 301 redirect that doesn't apply to subsites

Scenario: I'm trying to set a 301 redirect so that https://foo.org/events is redirected to a non-WordPress site https://bar.org/events. On my .htaccess file, I set the following: Redirect 301 /events ...
0
votes
0answers
25 views

Open wordpress page in directory the way index.html would open

I have a directory /mydir. If I put an index.html in there, it will open when someone browses to example.com/mydir, and their browser shows only the path, not index.html. How can I get the same ...
0
votes
1answer
19 views

Point 404 pages to homepage

I would like to build a website where all page URLs point to the homepage. Wordpress already shows URLs like website.com/randomstring/ as a 404 page. However, instead of the 404 error, I would like ...
1
vote
0answers
12 views

How can I redirect a URL to an anchor link while maintaining the URL?

I am building a one-page website which has multiple sections which I have implemented using a custom theme to display all my pages in one single homepage. I would like the user to be able to navigate ...
2
votes
1answer
10 views

Menu links only using http after enabling https, unable to redirect http links

I have a WordPress website on a Bluehost shared hosting server and since I have multiple websites in my space, I have this particular folder in its own folder under public_html. This means that I have ...
0
votes
1answer
888 views

Unable to find 'full-path' to my 404.php file

I'm trying to find the full path of my 404.php file. I thought it would be like this: ErrorDocument 404 /index.php?error=404 The reason for this is because I am trying to redirect non-IP permitted ...
0
votes
0answers
21 views

Unable to redirect on correct page (if user is not logged in)

I am using paid membership pro plugin to manage the users and their subscription at website, I am facing this issue, I have News page (setup as Posts page) and some categories of News (posts ...
0
votes
0answers
70 views

How to allow only vpn access to dashboard on Bitnami WordPress by IP address restricting

I'm trying to restrict access to the Bitnami WordPress(with apache) dashboard to VPN access only. The current environment is below. The WordPress site The site build by AWS Lightsail WordPress ...
0
votes
2answers
814 views

Remove/hide a specify category-name from the url

I have several categories post: General News Comedy Competitions Culture Gaming Food etc The posts url are in the following format: www.mydomain.com/category-name/post-title Example: www.mydomain....
3
votes
2answers
4k 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 ...
1
vote
1answer
47 views

How to remove duplicate and unnecessary part in a url using htaccess and regex?

I want to permanently redirect some URLs that have been removed and robots insist on following it. I have the default WordPress configuration for .htaccess. www.example.com/customers/em/customers/any-...
0
votes
1answer
1k views

Rewrite Page Parameters

i have a page call "city" http://localhost/wordpress/city/ and it get details from mysql by url id like http://localhost/wordpress/city/?id=paris and i want to change it like http://localhost/...
0
votes
1answer
3k views

modifying htaccess for localhost with a custom port

I have a live instance of wordpress which I'm attempting to spin up on my local machine using xampp. A brief summary of steps to where I'm currently at: configured xampp to use a custom port (8012) ...

1
2 3 4 5
26