In some circumstance, customer may update the website.
Customer’s original website may be (e.g.) at /shop/
Customer’s new website may be (e.g.) at /shop2/

Then, after the new website (e.g.) /shop2/ launch, it’d better to redirect existing traffic from old path (e.g. /shop/) to new path (e.g. /shop2/)

User may consider to use Apache mod_rewrite to create such URL redirection.

In old folder (e.g. /shop) , create a .htaccess with the following content –

Case 1: Redirect from /shop/* to /shop2/ (no filename appended)
e.g. http://www.xxx.com/shop/a.php -> http://www.xxx.com/shop2/

RewriteEngine On
RewriteBase “/shop/”
RewriteRule “(.*)$” “/shop2/” [R=301,NC,L]

Case 2: Redirect from /shop/* to /shop2/* (with the same filename attached)
e.g. http://www.xxx.com/shop/a.php -> http://www.xxx.com/shop2/a.php

RewriteEngine On
RewriteBase “/shop/”
RewriteRule “(.*)$” “/shop2/$1” [R=301,NC,L]

Pin It on Pinterest

Share This