[英]Remove last directory from URL using htaccess
我的問題是,如何使用 htaccess 規則刪除最后一個目錄。
http://mywedding.com/anandn/
should load content of
http://mywedding.com/anandn/theme/
OR
http://mywedding.com/mamtaandkuldip/
should load content of
http://mywedding.com/mamtaandkuldip/theme/
提前致謝。
將此規則放在DocumentRoot/.htaccess
文件中:
RewriteEngine On
RewriteRule ^([^/.]+)/?$ /$1/theme/ [L]
在 mywedding.com/anandn/index.php 中寫入以下代碼 header("location:mywedding.com/anandn/theme/");
它會將您重定向到您的網站。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.