2015-09-30 81 views
0

我試圖用.htaccess重寫我的網址來美化我的網址,但我得到頁面錯誤。我感到驚訝的是它使用xampp在我朋友的機器上工作,我在我的linux機器上使用apache。重寫URL頁面未找到.htaccess

# Turn Rewrite Engine On 
RewriteEngine On 

# Rewrite for info.php?id=xx 
RewriteRule ^photos/([0-9]+) info.php?id=$1 [NC,L] 

# Rewrite for profile.php?user=xx 
RewriteRule ^user/([0-9a-zA-Z_-]+) profile.php?user=$1 [NC,L] 

# Rewrite for logout.php?redirec=xx 
RewriteRule ^logout/([0-9a-zA-Z]+) logout.php?redirect=$1 [NC,L] 
+0

你得到什麼錯誤? – Krii

+0

找不到頁面。 –

+0

你檢查過你的'RewriteBase'嗎? – Krii

回答

0

最可能的錯誤原因似乎是mod_rewrite未加載。檢查apache的httpd.conf文件,並搜索行:

LoadModule rewrite_module modules/mod_rewrite.so 

如果收到了#,刪除並重新啓動服務器。

+0

我仍然沒有找到錯誤。 –