![](/img/trans.png)
[英]Redirect Subdomain to Subdirectory without changing URL multiple WordPress
[英]Redirect subdirectory to root subdirectory without changing url PHP
https://example.com/app1
這是我的子目錄,它在Apache服務器上運行一個index.html文件。
我需要在不更改URL的情況下將所有請求重定向到該目錄,例如https://example.com/app1/*
到https://example.com/app1
。
如果用戶訪問https://example.com/app1/test
,則應將其重定向到https://example.com/app1
但URL應與https://example.com/app1/test
保持相同
您可以在public_html/. htaccess
使用此規則public_html/. htaccess
public_html/. htaccess
:
RewriteEngine on
RewriteRule ^app1/((?!index\.html).+)$ /app1/ [NC,L]
Options +FollowSymlinks RewriteEngine on RewriteRule ^([a-zA-Z0-9_-]*)$ index.php [nc,qsa]
這個為我工作。
謝謝大家。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.