2013-08-31 105 views
0

我試圖改變這個網址: example.com/stickit/note.php?note=1
這樣: example.com/stickit/note/1mod_rewrite的 - URL與子目錄

我試圖做這種方式,但我得到的是一個404錯誤:

RewriteEngine On 
RewriteRule ^stickit/note/(.*)$ /stickit/note.php?note=$1 [L] 

有趣的是,這個工程:

RewriteEngine On 
RewriteRule ^note/(.*)$ /stickit/note.php?note=$1 [L] 

它改變example.com/stickit/note.php?note=1
到:example.com/note/1

回答

0

嘗試沿着這些路線的東西...

RewriteEngine On 
RewriteRule ^note/(.*)$ /stickit/note/$1 [L] 

我也寫了一篇博客文章,可以幫助您更好地瞭解阿帕奇重寫......

http://www.jabcreations.com/blog/apache-domain-neutral-redirect

始終確保您注意您的Apache訪問和錯誤日​​志,它們將幫助您瞭解正在發生的事情。