2016-07-26 82 views
0

在URL我已經一個的index.php頁&有一些職位對that.when更多按鈕被點擊,用戶被重定向到all.php其中包含完整的文章。實際上,在all.php lokks的URL這樣更改%20 - 使用htaccess的

http://localhost/project/all.php?rm=How%20to%20create%20jQuery%20Popup

我想改變%20-。 有無論如何與htaccess

回答

0
RewriteEngine On 
RewriteBase/

# external redirect from actual URL to pretty one (remove query string) 
RewriteCond %{THE_REQUEST} \s/+content\.php\?page=([^\s&]+) [NC] 
RewriteRule^%1? [R=302,L,NE] 

# convert all space (%20) to hyphen 
RewriteRule "^(\S*) +(\S* .*)$" $1-$2 [N,NE] 
RewriteRule "^(\S*) (\S*)$" $1-$2 [L,R=302,NE] 

# rewrite rule to call actual PHP handler 
RewriteRule ^([^./]+)\.html$ content.php?page=$1 [L,QSA,NC] 
+0

請問您能否解釋我的網頁名稱來自何處? – Anonoymous