: Rewrite URLs not working - wrong method or conflict? I've been at this for about an hour now and I'm not having much luck. htaccess files are quite new to me, so I'm obviously doing something
I've been at this for about an hour now and I'm not having much luck. htaccess files are quite new to me, so I'm obviously doing something very wrong.
Current htaccess content, which I need to keep:
RewriteEngine On
RewriteRule ^blog-page-([^-]*)$ ?page=&p=home [L]
RewriteRule ^blog-([^-]*)+? ?d=&p=home [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?p= [L]
I need to redirect 100+ old (WordPress) URLs back directly to the domain, such as:
/some-url-as-seen-by-google/ -> domain.co.uk
They all follow the same pattern, for example:
/something/some-url-as-seen-by-google/
/some-url-as-seen-by-google/
I've tried all kinds of RewriteRule, RedirectMatch 301, Redirect 301 rules, but I just can't seem to get my head around it, or get it to work.
More posts by @Candy875
1 Comments
Sorted by latest first Latest Oldest Best
The URLs you want to redirect to the home page are all currently handled by this rewrite rule:
RewriteRule ^(.*)$ index.php?p= [L]
so you have a conflict.
I use this WordPress plugin for these types of redirects:
Quick Page Post Redirect Plugin. You have to specify all of the redirects individually rather than with a pattern, but with only 100, that sounds doable.
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.