[英]Remove base folder from url with htaccess
我正在嘗試重寫
http://127.0.0.1:8888/folder/page/display-6.html
至
http://127.0.0.1:8888/page/display-6.html
htaccess文件在目錄中
這是我的.htaccess文件:
Options +FollowSymLinks -MultiViews
RewriteEngine on
RewriteCond %{REQUEST_URI} folder/(.*)
RewriteRule ^(.*)$ / [L]
您可以使用以下規則:
Options +FollowSymLinks -MultiViews
RewriteEngine on
RewriteCond %{THE_REQUEST} /folder/(\S+)
RewriteRule ^ /%1 [L,R]
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.