I need to redirect my old site links to new site links as follows.
OLD site Links
Folder level 3
http://mysitex.com/research/000/000/file.php
http://mysitex.com/research/010/008/file1.php
http://mysitex.com/research/000/000/file2.php ....etc more different names links
New links must be,
http://mysitenew.com/research/000/000/file.php
http://mysitenew.com/research/010/008/file1.php
http://mysitenew.com/research/000/000/file2.php ....etc more different names links
NOTE: In above new folder names are not always same to old folder names. Ex: 000/000/files ->>> 010/008 like that. There are dynamic.
So domain name is different and last file name is same and folder's names are not always same to old names. May be change.
Please anyone can help me? Appreciate that. Thanks
Added new.
Here is the contents I'm currently using in the htaccess file.
Options -MultiViews
RewriteEngine On
redirect 301 /research/000/000/ http://mysitenew.com/research/000/000/
RewriteCond %{THE_REQUEST} ^.*/index\.php
RewriteRule ^(.*)index\.php$ /$1 [R=301]
redirect 301 /index.php http://mysitenew.com/
Other contents are normal like above last 301 redirection code and located end of the file.
Thanks
Try this code in your DOCUMENT_ROOT/.htaccess
file of old domain:
RewriteCond %{HTTP_HOST} ^(www\.)mysitex\.com$ [NC]
RewriteRule ^research(/|$) http://mysitexnew.com%{REQUEST_URI} [L,NC,NE,R=301]
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.