0
我需要mod_rewrite的隱藏 「.php」 結尾(無查詢字符串)
domain.com/file.php
到
domain.com/file
我看過其他問題,但大多數都是關於隱藏文件名和只是dis打querystrings,我不打算使用querystrings
我需要mod_rewrite的隱藏 「.php」 結尾(無查詢字符串)
domain.com/file.php
到
domain.com/file
我看過其他問題,但大多數都是關於隱藏文件名和只是dis打querystrings,我不打算使用querystrings
你確定none of these worked for you?很多答案都是你想要的。例如,第一個結果具有下列規則:
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^(.*)$ $1.php [L]
或者,你可以嘗試打開並讓那爲您處理:
Options +Multiviews
RewriteCond %{HTTP_HOST} ^domain.com$
RewriteRule ^/file.php$ /file [L,R=301]
沒有看到,但它確實訣竅,謝謝你 – 2012-07-15 20:33:02