我還不知道什麼是「的FollowSymLinks」確實,但其餘的這是否:
RewriteEngine On <-- activates mod rewrite
RewriteCond %{REQUEST_FILENAME} !-d <-- condition that says: request filename is not directory
RewriteCond %{REQUEST_FILENAME}\.php -f <-- condition that says: request filename with the appendix .php is a file
RewriteRule ^(.*)$ $1.php <-- take anything you get and put a .php behind it
告訴它在人的話: 如果請求的文件名不是一個目錄,如果你追加。 PHP來該文件名,它是現有的文件然後執行該追加.php後綴的pool
這個工作對我的XAMPP重寫規則:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^(.*)$ $1.php [L]
</IfModule>
<IfModule !mod_rewrite.c>
ErrorDocument 404 /index.php
</IfModule>
你確定mod_rewrite並啓用nd工作?你有沒有嘗試其他規則? – Gumbo 2010-10-02 12:35:47
我是新來的這個我怎麼啓用mod_rewrite – DonJuma 2010-10-02 12:37:09
@Matthew Carter:嘗試一個非常簡單的規則,比如'RewriteRule^http://example.com/?'。 – Gumbo 2010-10-02 12:38:11