1
我需要有mod_rewrite的規則去除comment.php
mysite.com/comment.php?id=sasdfkjsfj
重定向到
mysite.com/sasdfkjsfj.
現在,我使用這個代碼,這樣做
RewriteEngine on
RewriteBase/
#redirect to remove comment.php
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /comment\.php\?id=([^\ &]+) [NC]
RewriteRule^%1? [L,R=301]
#process the SEF Url with comment.php
RewriteRule ^([-a-zA-Z]+)$ comment.php?id=$1 [L]
它將url地址更改爲
mysite.com/sasdfkjsfj.
但這會導致404頁面錯誤。我這是做這項工作的
mysite.com/comment.php?id=sasdfkjsfj
在那裏我通過$ _GET [「身份證」]從URL獲得ID,但現在一個單獨的頁面comment.php,如何處理
mysite.com/sasdfkjsfj
重定向後。
而且也什麼樣的變化,我必須讓這種類型的URL
mysite.com/sasdfkjsfj/Url_redirect_option.
你處理你的通過'index.php'評論? – ThinkingMonkey 2012-02-07 16:57:31
@ThinkingMonkey不,我有一個單獨的頁面comment.php。我想要的是,重定向後如何顯示以前由mysite.com/comment.php?id=sasdfkjsfj顯示的內容 – 2012-02-07 17:11:02