我是新來重寫URL,想知道我怎麼會改寫mod_rewrite的用戶ID錯誤
從這個 /資料/ 4
對此 /profile.php?id=4
我有這樣的規則至今
RewriteRule ^profile/([0-9]+)/?$ profile.php?id=$1
,但它顯示這個瀏覽器
Firefox檢測到服務器正在以永不完整的方式重定向該地址的請求。
它在瀏覽器地址欄中顯示/profile/4/index.php錯誤。
.htaccess文件
<Files .htaccess>
order allow,deny
deny from all
</Files>
Options +FollowSymlinks
RewriteEngine on
#ErrorDocument 404 /test.php
DirectoryIndex test.php
RewriteRule settings editProfile.php
RewriteRule update update.php
RewriteRule home test.php
RewriteRule ^profile/([0-9]+)/?$ profile.php?id=$1
你可以發佈你的整個.htaccess文件嗎? –
爲什麼你需要整個.htaccess文件? mod_rewrite已啓用,我可以編寫其他網址而不是上面的網址。 – unleashed
@unleashed由於Apache將使用您的整個'.htaccess'文件。 –