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
0 votes
1 answer
10 views

Other pages fine but wp-admin showing ERR_TOO_MANY_REDIRECTS Error

wp-admin showing ERR_TOO_MANY_REDIRECTS Error and can't let me login into dashboard but Other pages loading fine. FIXED
1 vote
1 answer
14 views

External rewrite rules missing in htaccess - Multisite

I'm trying to set up some external redirects, but it seems like they are not being added to htacccess even tho it's supposed to (I think). add_rewrite_rule('^dashboard\/([^.]+\.(jpe?g|gif|bmp|png))$', ...
  • 11
1 vote
0 answers
18 views

Enable webp support Nginx+Apache reverse proxy with moss.sh [closed]

I am scratching my head from last few hours but unable to get reliable source to solve below problem. Actually, I am trying to setup WP Smush (or any webp plugin) with webp support on Nginx + apache ...
0 votes
1 answer
32 views

Wordpress redirection

I tried to import my Wordpress website, localy on a RHEL OS. Finally, 80% f the pages seems to be OK and are displaied except 20% of them.. I've noticed that it depends on the URL format https://site1....
0 votes
0 answers
24 views

Add rewrite rule to make Woocommerce product category page seo friendly

I want to show sale products of that particular product category page by using /sale except using a query string stock_status=onsale. e.g https://www.example.com/sneaker/?stock_status=onsale It ...
0 votes
1 answer
16 views

.htaccess found in every folder

every week my site's every folder has .htaccess when try to open the site it gets a virus error. I remove .htaccess manually from every folder and then the site works. but after a few days, I got the ...
1 vote
1 answer
41 views

Redirect ignore last URL segment

I have a page on my Wordpress website that I want to effectively have a wildcard on the end of the URL. The URL is "https://www.mywebsite.com/map". I want that same page to be directed too ...
  • 121
1 vote
1 answer
36 views

How can I redirect a request to the site root using htaccess, if there's not a specific cookie set?

I'm using this code, versions of which I've seen referenced on various other sites, but it always redirects home page requests to /fr/ if the browser is set with French as a primary language ...
0 votes
0 answers
24 views

All navigation links on website redirect to same page

I just migrated a site from a staging server to the live server and on the live server all the nav links redirect to the same page. The URLs in the address bar are correct, but the page is different. ...
1 vote
1 answer
31 views

how to prefer static page if it exists over wordpress page

I've created a custom post type for my landing pages, which each sit at www.mydomain.com/lp/<page-name>/ I want to keep those custom posts there, so they show up with proper featured images and ...
1 vote
1 answer
103 views

Disabling direct access to images using .htaccess

I have installed Wordpress in a subdirectory of a subdomain. I am using the following rewrite rule to direct all urls to this subdirectory. RewriteCond %{HTTP_HOST} ^(www\.)?mysubdomain.mydomain\. ...
  • 13
0 votes
0 answers
13 views

WordPress redirect to new domain name

I would like to redirect my WordPress website to a new domain but I want to do it correctly with .htaccess file. I want to redirect only the brands page, products pages, product categories, product ...
  • 1
1 vote
0 answers
46 views

How do I add /blog/ as a prefix to permalink structure for posts, categories & tags?

The URL structure I am hoping for is as follows: All posts: /blog/ and /blog/page/2 Categories: /blog/%category%/ and /blog/%category%/page/2 Post: /blog/%category%/%postname%/ Tags: /blog/%tag%/ and ...
1 vote
1 answer
62 views

How can i redirect one url to another url using .htaccess or add_rewrite_rule

I am stuck at redirecting one url to another url. I want to redirect https://samedomain.com/page-check-927GSJAYS639AL/highlights to https://samedomain.com/page-highlights/ (927GSJAYS639AL this is id ...
0 votes
0 answers
8 views

can't install any wp plugins [duplicate]

We recently moved WP hosts. We backed up WP and imported it to a development site wp.mysite.com to get it all set up. Once everything was done, we switched the DNS and went live with newdomain.com on ...
  • 101
0 votes
0 answers
51 views

Creating dynamic content and pages for 1000's of locations

How can I generate dynamic pages on a Wordpress website from information provided in a separate MySQL database? I have a database with Locations and I would like to have a page for each of these ...
0 votes
0 answers
28 views

Help with htaccess querystring rewrite

Been working on a solution to remove odd query strings from pages after search engines keep adding them at random. I have a solution that semi works, but I would ideally like to see it clear them all. ...
0 votes
0 answers
14 views

How to make Subdomain work for product_tag?

I'm trying to find a way to make subdomains work for some of my product_tags. For example nike.myshop.com will display the content of myshop.com/product_tag/nike. I googled for a long time, but most ...
  • 1
0 votes
0 answers
31 views

.htaccess with Wordpress - create my own pretty url with parameters (above Wordpress settings)

(first of all, sorry for my poor english) I have an url what is works just fine: example.com/myevent/?e=event_unique_title , I like to change the way to see it in the address bar to: example.com/...
0 votes
0 answers
14 views

WordPress Multisite and how to apply sef urls only to specific sites

I have a WordPress Multisite installation with its main url set to https://web.mydomain.com (there are some nginx proxies behind this url which I can't manage) Most of the sites are generated as https:...
  • 53
1 vote
1 answer
33 views

Override htacces rule only for specific directory

I have a WordPress site with ithemes security installed plugin. I want to disable this rule: RewriteCond %{HTTP_USER_AGENT} "^$" [NC,OR] only for this wp-content/uploads/xmls directory. ...
1 vote
3 answers
241 views

Wordpress Redirect 301 register page

I have a custom register form page, and I want to create a 301 redirect to force people to use this form (and not the original URL of WordPress) I try to do a redirect 301 like this in my .htaccess, ...
  • 157
1 vote
0 answers
34 views

HTTP Error 406 always on site?

Hello WordPress community, I am getting http 406 error in my website when ever I tried to change something in my site. it looks similar like this below line This page isn’t working If the problem ...
0 votes
1 answer
36 views

Multisite Subdirectory Site Dashboard redirect loop

I recently activated multisite and received my code to add to wp-config.php. WordPress wanted to force me to use subdomains. I wanted to use subdirectories, so I used: define( 'WP_ALLOW_MULTISITE', ...
  • 1,588
1 vote
1 answer
148 views

Wordpress 404 on Subdomain

I have taken a copy of my Wordpress website and set up a subdomain, and virtual host (/var/www/subdomain/) on the existing websites server. After moving the copy of the website I am getting a 404 ...
0 votes
1 answer
18 views

Permalinks do not include www subdomain

I recently migrated a website which was both hosted with and without www subdomain. I configured the .htaccess to always redirect to www: RewriteCond %{HTTP_HOST} ^[^.]+\.[^.]+$ RewriteCond %{HTTPS}s ^...
  • 101
0 votes
0 answers
39 views

How many .htaccess files should a Wordpress multisite (subdirectory set up) have?

We have a multsite subdirectory site with two sites. We set this up several years ago and everything has been working correctly until recently. One thing I'm trying to find out is how many htaccess ...
2 votes
0 answers
31 views

Should I add the IP of the server that hosts my sites to the list of authorized IPs in the wp-admin/.htaccess?

All of my sites were recently hacked and I had to restrict access to the WordPress admin. The logs are now full of denied connections, but I also see errors coming from the IP of the server that ...
  • 123
0 votes
2 answers
59 views

Moving wordpress to different url/server creates redirect loop

I'm trying to move my wordpress site in to different server and url. How ever i seem to have a persistent redirect loop problem. I think this is not a cache, cookie or plugin problem and I am ...
0 votes
0 answers
10 views

What causes 404 errors that forces you to rebuild a .htaccess file?

What causes 404 errors that forces you to rebuild a .htaccess file? Some css files were leading to 404, a theme change was done recently and I did a git clone of the project and composed up a new ...
  • 103
0 votes
0 answers
28 views

Configure .htaccess to have a WordPress single site installation with all subdomains pointing to the same pages?

I need to configure the .htaccess file, for a WordPress single site installation (no multisite), in order to have several subdomains pointing to the same content (same page structure). For example: ...
0 votes
1 answer
37 views

Hosting 2 WordPress websites in /public_html/ & /public_html/subdirectory/ at the same time

Previously, we had a subdomain multisite in /public_html/: www.example.com (primary site) site1.example.com site2.example.com plus another subdirectory multisite in /site3.example.com/ site3....
  • 1,588
0 votes
0 answers
47 views

WordPress is removing trailing slash

Unfortunately, it seems I have a misconfiguration in my wordpress instance. WordPress seems to remove the trailing slash. This only happens when the domain is accessed via www. When I open http://...
  • 149
0 votes
0 answers
59 views

How do I properly redirect requests to Wordpress subdirectory?

Still learning things with Wordpress installation. Was trying to follow this guide to redirect from public_html to wp so that visitors don't see the page displaying available folders. I'm not totally ...
  • 101
1 vote
0 answers
38 views

change permalink structure with htaccess without SEO impact

I can read a lot of questions about this topic but with different interpretations. I'm going to change my permalink structure from http://www.example.com/%year%/%monthnum%/%day%/%postname%/ to http://...
  • 11
0 votes
0 answers
26 views

Redirect posts to new domain

Im having problems trying to redirect custom post type posts to a new domain, using an htaccess file. It redirect my no wp static pages, but it has no efect on custom post type pages. Here i my code: ...
0 votes
0 answers
22 views

How to serve Wordpress folder over subdomain?

I have wordpress website www.example.com I have one subdomain whose folder is also created in public_html which is same as wordpress installation folder. What I'm looking for is if someone use apps....
0 votes
0 answers
42 views

.htaccess Rewrite URL WordPress

I have split a URL with JavaScript i have to rewrite it with .htaccess, the issue is that after splitting URL the page takes me to 404 error. I do not have much knowledge of .htaccess, can you help me ...
  • 149
1 vote
0 answers
119 views

Two Different Links for Same Product - WooCommerce [closed]

The idea here is to publish one WooCommerce Product to 2 unique Links. This way, we can edit the product at both Links in one location. However, can use functions.php to alter content by reading the ...
  • 11
1 vote
0 answers
187 views

Headers Content-Security-Policy CSP Major Issue

Im trying to add CSP : Header add Content-Security-Policy "script-src 'self';" - to my htaccess, seems like this line keeps breaking my site, The blocks gets broken, Unable to edit ...
0 votes
0 answers
22 views

How to fix redirection of Post/Page of wordpress inside the wordpress?

I have Wordpress inside the wordpress root. For example www.test.com (main site) then i have additional wordpress which is www.test.com/media (child). Everything is good, but except for posts and ...
1 vote
1 answer
34 views

htaccess rules not applied?

So here is the full .htaccess file, with code added to redirect all urls/pages to the only accessible page of the site, except content, includes and admin ones: # BEGIN WordPress # The directives (...
1 vote
0 answers
458 views

How to Change The WordPress Login URL Without Plugin

I'm looking for a way to change the wordpress admin login url from site.com/wp-login.php or sit.com/wp-admin.php to my custom login url like site.com/mylogin. I want to this without using plugin or ...
  • 21
0 votes
0 answers
40 views

Multisite htaccess file causing segfault (Segmentation fault 11)

When I replace the .htaccess file content with the one provided on the Multisite Network Setup page, I cannot login to WP admin. I get ERR_EMPTY_RESPONSE. After I checked the Apache error log, I ...
  • 181
1 vote
1 answer
799 views

Change htaccess to redirect to index.php in subfolder

How can I change the WordPress root folder .htaccess file to redirect URLs with a specific subfolder to its own index.php and give the path data as a URL variable to the index.php? https://example.com/...
  • 41
0 votes
0 answers
25 views

Exclude subfolder in WordPress permalink

I have built a test website with this permalink structure: https://www.test.de.www279.your-server.de/ Now I exported it to a live domain with all in one wp migrate and urls got changed aligned to the ...
  • 1
0 votes
1 answer
32 views

Bad pages redirection

I have a wordpress web site with only a private pages (can only be viewed by logged users) I use the below code in my theme functions.php to be redirected to login page each time a put the page URL on ...
  • 304
1 vote
0 answers
77 views

Redirecting amp url to non amp url

My wordpress use custom permalinks url with rules /%postname%.html And Htaccess rules # This file was updated by Duplicator Pro on 2021-11-02 05:53:04. # BEGIN WordPress <IfModule mod_rewrite.c>...
0 votes
1 answer
20 views

301 all old pages to new location

I have a blog that used to be located in a directory on my domain mydomain.co.uk/Blog I have now moved the blog to the root mydomain.co.uk How do i 301 all of my old pages to the new ones? I have ...
  • 1
1 vote
0 answers
58 views

WordPress Multisite's in subdirectory not redirecting to dashboard settings

I am not sure what's happened but our WordPress multisite that's been in a subdirectory for the longest time now refuses to redirect to the WPMS dashboard pages. Settings, themes, plugins etc. All the ...
  • 23

1
2 3 4 5
27