1
我想從/page.html
重定向到/page
子目錄內,但它不起作用。重定向/page.html到/頁面不起作用子目錄內
- 我做什麼:
http://example.com/subdirectory/page.html
- 我能得到什麼:
http://example.com/page
- 我想要什麼:
http://example.com/subdirectory/page
.htacces文件:
RewriteEngine On
#example.com/page will display the contents of example.com/page.html
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.html -f
RewriteRule ^(.+)$ $1.html [L,QSA]
#301 from example.com/page.html to example.com/page
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /.*\.html\ HTTP/
RewriteRule ^(.*)\.html$ /$1 [R=301,L]
我該如何得到這個工作?