
: Full domain .htaccess 301 keeping same paths, but also redirect some URLs to different paths I believe the following code will redirect my old domain to my new domain keeping the same URL paths.
I believe the following code will redirect my old domain to my new domain keeping the same URL paths.
RewriteEngine on
RewriteCond %{HTTP_HOST} !^www.newdomain.co.uk
RewriteRule (.*) www.newdomain.co.uk/ [R=301,L]
However, I also have some URLS from my old site that don't exist on my new site, so they would return a 404 with the rule above.
How do I redirect these to an alternative URL path?
More posts by @Megan663

: Canonical and place in country I have a website that is divided for the UK, thus I have it as for the UK in its entirety I have it as: example.org/index.php << parent site example.org/england/index.php

: Prevent Google using my site in featured snippet result I have noticed in the past few months that traffic to the QA section of my site has plummeted. The vast amount of the 300+ pages here
1 Comments
Sorted by latest first Latest Oldest Best
You simply need to redirect these specific URLs before your catch-all redirect above. For example:
RewriteRule ^old-url-does-not-exist$ /new-url-that-does-exist [R=301,L]
Just to note... in .htaccess there is no slash prefix on the source URL pattern, ie. the regex ^old-url-does-not-exist$ matches the URL /old-url-does-not-exist. Whereas there is a slash prefix on the destination URL. That's just RewriteRule syntax.
Terms of Use Create Support ticket Your support tickets Powered by ePowerPress Stock Market News! Top Seo SMO © topseosmo.com2022 All Rights reserved.