Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

htaccess rewrite directory

I moved my website from the /v1/etc... directory to the /v2/etc... directory and would like to make a permanent redirect in htaccess. Can someone help me?

like image 314
Mark Henry Avatar asked Feb 27 '23 08:02

Mark Henry


1 Answers

You can use either mod_rewrite:

RewriteEngine on
RewriteRule ^v1(/.*)?$ /v2$1 [L,R=301]

Or mod_alias:

Redirect permanent /v1 /v2
like image 167
Gumbo Avatar answered Mar 08 '23 10:03

Gumbo