htaccess 301 redirects incorporate part of source URL into target URL ->404 erro
-
Hi we have sold our business https://www.peteranne.it and are redirecting pages to corresponding pages on new owner’s website https://www.lemonhouse.eu which is hosted on a different server. We have had redirects from pre-2010 version of pre-WP site for 6 years, worked perfectly WITHIN https://www.peteranne.it, but now have following problem directing to DIFFERENT top-level URL:
OK: https://www.peteranne.it/climbing/ redirects perfectly to https://www.lemonhouse.eu/climbing/ using Redirect 301
FAILS: https://www.peteranne.it/climbing/climbing-guidebooks/ FAILS to redirect to https://www.lemonhouse.eu/climbing/ and instead is redirected to https://www.lemonhouse.eu/climbing/climbing-guidebooks/ which does not exist. Part of the “from” URL is being entered into the “to” URL. Since the new owner’s site has only one “climbing” page, we want to redirect both our “climbing” and “climbing/climbing-guidebooks/ page to the one new climbing page.Please can someone suggest a fix? Is there anzthing we need to get the owner of the target site to fix?
thanks Peter & Anne. Below is our htaccessRewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ – [L]#without prefix www
RewriteCond %{HTTP_HOST} ^peteranne.it [NC]
RewriteRule ^(.*) https://www.peteranne.it/$1 [L,R=301]# uploaded files
RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wp-includes/ms-files.php?file=$2 [L]
# add a trailing slash to /wp-admin
RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ – [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
RewriteRule . index.php [L]# BEGIN WordPress
<IfModule mod_security.c>
SecFilterEngine Off
SecFilterScanPOST Off
</IfModule>
# END WordPressRedirectMatch 301 ^/blog/(.*)$ https://www.lemonhouse.eu/
Redirect 301 /climbing/climbing-guidebooks/ https://www.lemonhouse.eu/climbing/
Redirect 301 /climbing/ https://www.lemonhouse.eu/climbing/
- The topic ‘htaccess 301 redirects incorporate part of source URL into target URL ->404 erro’ is closed to new replies.