to https://www.example.com/new
Step 1: enable overwrite in httpd.conf
Options FollowSymLinks
#AllowOverride None
AllowOverride all
Step 2, generate .htaccess under root /
[root@localhost html]# pwd
vim /var/www/html/.htaccess
RewriteEngine On
RewriteCond %{SERVER_PORT} 80 [OR]
RewriteCond %{SERVER_PORT} 443
RewriteRule ^(/)?$ https://www.example.com/new/$1 [R,L]
No comments:
Post a Comment