您好,我希望實現以下目標,但我不確定是否可以使用.htaccess和/或如何這樣做。htaccess url重寫到子目錄而不更改地址欄
http://domain/admin/rest should go to http://domain/backend/www/rest
http://domain/rest should go to http://domain/frontend/www/rest.
但最好不更改地址欄中的網址。 其餘的可以是'news/1 /'之類的東西。
如果在.htaccess中無法使用,請指向正確的方向。你的文檔根
Options +FollowSymlinks -MultiViews
RewriteEngine On
RewriteBase/
RewriteCond %{REQUEST_URI} !/(frontend|backend) [NC]
RewriteRule ^admin/(.*)/? /backend/www/$1 [L,NC]
RewriteCond %{REQUEST_URI} !/(frontend|backend) [NC]
RewriteRule ^(.*)/? /frontend/www/$1 [L,NC]