Rewrite URLs not working - wrong method or conflict?

Rewrite URLs not working - wrong method or conflict? - If a page has internal and external outgoing links to redirecting URLs, it’s returning 3xx (301, 302, etc.) HTTP status codes standing for redirection. This issue means that the page does not exist on a permanent or temporary basis. It appears on most of the popular web browsers, usually caused by a misconfigured website. However, there are some steps you can take to ensure the issue isn’t on your side. You can find more details about redirecting URLs by reading the Google Search Central overview. In this article, we’ll go over how you can fix the Rewrite URLs not working - wrong method or conflict? error on your web browser. Problem :


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.


Solution :

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.


We hope that this article has helped you resolve the htaccess, redirects, 301-redirect error in your web browsers. Enjoy browsing the internet uninterrupted!

Comments

Popular posts from this blog

How do I redirect traffic only if being accessed from a specific port?

How to redirect to any domain [duplicate]

DNS entry to redirect constant url to changing directory name