[英]Apache URL rewrite
我可以按以下方式訪問我的php symfony 2應用程序網址:
http://localhost/jba/php/web/app_dev.php/login
我想將其縮短,以便在瀏覽器請求時
http://localhost/login
它顯示原始頁面。 我試過了:
RewriteEngine On
RewriteRule ^(.*)$ jba/php/web/app_dev.php/$1
但它沒有用(只是說“未找到”)。 重寫日志說:
(2) init rewrite engine with requested uri /login
(1) pass through /login
正確的RewriteRule是什么?
試試這個,讓我知道它是否適合您。
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/\.]+)/?$ jba/php/web/app_dev.php/$1 [L]
嘗試
RewriteEngine On
RewriteRule ^/(.*)$ /jba/php/web/app_dev.php/$1
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.