我正在開發一個php框架工作,我是.htaccess規則的新手。所以我需要使用.htaccess重定向 網址。鏈接從url中刪除index.php htaccess
http://localhost/rinocabs/index.php?/Galary/Image/
應在.htaccess文件轉換爲這個
http://localhost/rinocabs/Galary/Image/
我包括這些規則
Options +FollowSymlinks
RewriteEngine on
rewritecond %{http_host} ^localhost/rinocabs/index.php?/Galary/Image/ [nc]
rewriterule ^(.*)$ http://localhost/rinocabs/Galary/Image/$1 [r=301,nc]
,但它不工作。請幫忙。
有用。很好,但是對我的問題沒有幫助。謝謝 –
你用'RewriteCond%{THE_REQUEST}^[AZ] {3,} \ s( 。*)/ index \ .php?[NC]' – sas
我對你的代碼很感興趣,我對htaccess代碼有新意,請你一行一行解釋一下這個代碼:) 我得到了這樣的結果 localhost/rinocabs/index.php?/ Galary/Image /結果爲 localhost/rinocabs/ –