htaccess and redirects not working
-
Hi everyone,
I just migrated a site to WordPress and there are many pages that don’t have the same URL anymore. What I want to do is redirect all non-existent pages to my homepage.
I’ve looked and researched a lot and found that this could be done through the .htaccess file.
Basically I created a blank notepad file, posted the code below, saved it as 1.htaccess(.txt) and uploaded to the public html folder. I also put the permissions to 666.
Why is this not working?
Below is the code I used:
RewriteEngine On RewriteBase / #if the query string has an a parameter RewriteCond %{QUERY_STRING} (^|&)a= [NC] #Redirect and remove query string parameters RewriteRule .* https://www.sakokasa.com/? [R=301,L] #if the query string has a pagewanted parameter RewriteCond %{QUERY_STRING} (^|&)pagewanted=all [NC] #Redirect and remove query string parameters for html pages RewriteRule (.+\.html) https://www.sakokasa.com/$1? [R=301,L]
Viewing 7 replies - 1 through 7 (of 7 total)
Viewing 7 replies - 1 through 7 (of 7 total)
- The topic ‘htaccess and redirects not working’ is closed to new replies.