![](/img/trans.png)
[英]JS and CSS Rendering Issues After .htaccess File URL Rewrite Rule
[英]Rewrite htaccess rule for different Url
我的網址為public/l/img/logo.png
,我想在公共目錄中使用htaccess來查看public/img/logo.png
。
我嘗試使用此功能,但不起作用
RewriteRule ^l/(.*)$ $1 [R=301,L]
我現在的htaccess
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
</IfModule>
和我的公眾是真實目錄,在此先感謝
情況1:如果public
是真實目錄,則在/public/.htaccess
使用此規則:
RewriteEngine On
RewriteBase /user/public/
RewriteRule ^l/(.+)$ $1 [NC,L]
情況2:如果public
不是一個真實目錄,則在root .htaccess
使用此規則:
RewriteEngine On
RewriteBase /
RewriteRule ^user/public/l/(.+)$ public/$1 [NC,L]
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.