2010-10-30 103 views
1

我想用Apache的mod_rewrite工具做簡單的重寫url。
當他們說我首先從爲什麼mod_rewrite工具正常工作?

LoadModule rewrite_module modules/mod_rewrite.so 

從CONF刪除#。文件。然後我重新啓動我的Apache。
現在我想是這樣的事情...

我的索引頁上存在一種他們是「關於我們」像這樣的一個鏈接一個菜單..

<a href="aboutus"><strong>about</strong></a> 

現在我的htaccessfile,我寫了這樣的事情......

Options +FollowSymLinks 
<IfModule mod_rewrite.c> 
RewriteEngine on 
RewriteBase/
RewriteRule ^aboutus$ tempindex.php?id=3 
</IfModule> 

,如果我試圖點擊關於我們那麼它的節目錯誤HTTP 404 - 未找到。

編輯: 我試圖讓我的網址爲

www.example.com/aboutus 

,但實際的URL將被

www.example.com/tempindex.php?id=3 

回答