Mobile app version of vmapp.org
Login or Join
Candy875

: 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

@Candy875

Posted in: #301Redirect #Htaccess #ModRewrite #Redirects #UrlRewriting

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.

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Candy875

1 Comments

Sorted by latest first Latest Oldest Best

 

@Heady270

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.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme