php - Redirect from one path to another using htaccess -


redirect 1 path using htaccess

i have urls these:-

https://www.example.com/au/path1  https://www.example.com/sg/path1  https://www.example.com/ca/path1  

and many more, want redirect these url type :-

https://www.example.com/au/path2  https://www.example.com/sg/path2  https://www.example.com/ca/path2 

but not getting desired result, here code :-

rewriteengine on  rewritecond %{request_uri} path1 rewriterule ^(.*)$ %{request_uri}/path2 [r=301,l] 

another solution redirect these urls 1 one redirect directive of apache mod_alias .

try in root/.htaccess file :

redirectpermanent /au/path1 /au/path2 redirectpermanent /sg/path1 /sg/path2 redirectpermanent /ca/path1 /ca/path2 

you can change redirectpermanent redirecttemp temporary redirect.


Comments

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -

How to provide Authorization & Authentication using Asp.net, C#? -