Last call to make your voice heard! Our 2022 Developer Survey closes in less than a week. Take survey.

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
0 answers
23 views

How can I remove multiple slashes?

Basically that, I have domain.com/ but if I visit domain.com// or with more slashes I would like to remove the extra ones and just leave one of them. I found this but it's not working, I added on the ....
user avatar
  • 2,171
1 vote
1 answer
49 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 ...
user avatar
0 votes
0 answers
7 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 ...
user avatar
  • 101
0 votes
0 answers
37 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 ...
user avatar
0 votes
0 answers
27 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. ...
user avatar
0 votes
0 answers
11 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 ...
user avatar
  • 1
0 votes
0 answers
16 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/...
user avatar
0 votes
0 answers
9 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:...
user avatar
  • 53
1 vote
1 answer
31 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. ...
user avatar
1 vote
3 answers
194 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, ...
user avatar
  • 157
1 vote
0 answers
24 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 ...
user avatar
0 votes
1 answer
21 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', ...
user avatar
  • 1,672
1 vote
1 answer
72 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 ...
user avatar
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 ^...
user avatar
  • 101
0 votes
0 answers
20 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 ...
user avatar
2 votes
0 answers
16 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 ...
user avatar
  • 123
0 votes
2 answers
30 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 ...
user avatar
0 votes
0 answers
8 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 ...
user avatar
  • 103
0 votes
0 answers
25 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: ...
user avatar
0 votes
1 answer
29 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....
user avatar
  • 1,672
0 votes
0 answers
16 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://...
user avatar
  • 147
0 votes
0 answers
39 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 ...
user avatar
  • 101
1 vote
0 answers
28 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://...
user avatar
  • 11
0 votes
0 answers
24 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: ...
user avatar
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....
user avatar
0 votes
0 answers
35 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 ...
user avatar
  • 117
1 vote
0 answers
46 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 ...
user avatar
  • 11
1 vote
0 answers
73 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 ...
user avatar
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 ...
user avatar
1 vote
1 answer
27 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 (...
user avatar
1 vote
0 answers
258 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 ...
user avatar
  • 21
0 votes
0 answers
31 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 ...
user avatar
  • 155
1 vote
1 answer
404 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/...
user avatar
  • 41
0 votes
0 answers
22 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 ...
user avatar
  • 1
0 votes
1 answer
29 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 ...
user avatar
  • 264
1 vote
0 answers
71 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>...
user avatar
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 ...
user avatar
  • 1
1 vote
0 answers
35 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 ...
user avatar
  • 23
1 vote
0 answers
151 views

What to write in the htaccess in order to detect browser language and point accordingly?

On short: I use Polylang plugin for my web but it's option to detect browser language won't work because I need to use cache in the whole site, including the homepage. I have a bilingual website (...
user avatar
  • 33
1 vote
1 answer
39 views

Use virtual pages point to one specific page

How should I approach this issue? I want to create one page, but many "virtual pages", e.g. like a productinfo.php. A product has several. In this case you manually create the posts in the ...
user avatar
1 vote
1 answer
35 views

Wordpress category page redirects in .htaccess not working

Wordpress automatically generates category pages, for example: https://planthardware.com/category/microgreens/recommended-equipment/ I want to redirect this to a custom page, for example: https://...
user avatar
0 votes
1 answer
35 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 ...
user avatar
0 votes
0 answers
32 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 ...
user avatar
1 vote
1 answer
387 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/...
user avatar
  • 113
1 vote
1 answer
24 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 ...
user avatar
2 votes
0 answers
49 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 ...
user avatar
1 vote
1 answer
36 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?
user avatar
  • 45
1 vote
1 answer
633 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 ...
user avatar
  • 78
0 votes
0 answers
21 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
user avatar
2 votes
1 answer
31 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 ...
user avatar

1
2 3 4 5
26