I moved my website from the / v 1 / etc ... directory to the / v 2 / etc ... directory and would like to do a permanent redirect to htaccess. Can anybody help me?
You can use mod_rewrite :
RewriteEngine on RewriteRule ^v1(/.*)?$ /v2$1 [L,R=301]
Or mod_alias :
Redirect permanent /v1 /v2
Put this:
RewriteEngine On RewriteRule /v1/(.\*) /v2/(.\*) [R=301,L]
in your .htaccess file.
.htaccess
RedirectMatch permanent /v1/(.*) /v2/$1
Source: https://habr.com/ru/post/1304497/More articles:Help implementing a C # project: multiple list arrays or a better way? - c #Compiled Linq-to-sql query returns an object not belonging to the presented DataContext? - linq-to-sqlArchiving database tables using Java - javaNSDocument Printing - objective-cHow to skip brackets on Netbeans with enter? - eclipseSOAP, REST, or just XML to solve Objective-C / iPhone vs server - soapFlex - Custom Component - Percentage Width / Height - actionscript-3ASPXAUTH public cookie and security - asp.netjQuery: stretch text area like chrome - jqueryHow to write byte by byte to a socket in PHP? - phpAll Articles