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 very wrong.
Current htaccess content, which I need to keep:
RewriteEngine On
RewriteRule ^blog-page-([^-]*)$ ?page=$1&p=home [L]
RewriteRule ^blog-([^-]*)+? ?d=$1&p=home [L]
RewriteCond %REQUEST_FILENAME !-f
RewriteCond %REQUEST_FILENAME !-d
RewriteRule ^(.*)$ index.php?p=$1 [L]
I need to redirect 100+ old (WordPress) URLs back directly to the domain, such as:
/some-url-as-seen-by-google/ -> www.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.
The URLs you want to redirect to the home page are all currently handled by this rewrite rule:
RewriteRule ^(.*)$ index.php?p=$1 [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.
Comments
Post a Comment