.htaccess htaccess重写与godaddy
正在尝试我的.htaccess页面重写此url.htaccess htaccess重写与godaddy,.htaccess,mod-rewrite,.htaccess,Mod Rewrite,正在尝试我的.htaccess页面重写此url www.mywebsite.com/view.php?2012/this-is-page.html 到 其中“view.php”是模板。。。我只是不喜欢“view.php?” 终于让这个CMS在“view.php”之后使用“?”而不是“/”——现在,我如何让它在浏览器URL窗口中重写它 到目前为止,我已经: #Fix Rewrite Options -Multiviews RewriteEngine on 通过httpd.conf启用mod_
www.mywebsite.com/view.php?2012/this-is-page.html
到
其中“view.php”是模板。。。我只是不喜欢“view.php?”
终于让这个CMS在“view.php”之后使用“?”而不是“/”——现在,我如何让它在浏览器URL窗口中重写它
到目前为止,我已经:
#Fix Rewrite
Options -Multiviews
RewriteEngine on
通过
httpd.conf
启用mod_rewrite和.htaccess,然后将此代码放入文档根目录下的.htaccess
:
Options +FollowSymLinks -MultiViews
# Turn mod_rewrite on
RewriteEngine On
RewriteBase /
# external redirect from view.php?2012/this-is-page.html to view/2012/this-is-page.html
RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s/+view\.php\?([^\s]+) [NC]
RewriteCond ^ view/%1? [L,R]
# internal forward from view/2012/this-is-page.html to view.php?2012/this-is-page.html
RewriteCond ^view/(.+)$ view.php?$1 [L,NC,QSA]
Options +FollowSymLinks -MultiViews
# Turn mod_rewrite on
RewriteEngine On
RewriteBase /
# external redirect from view.php?2012/this-is-page.html to view/2012/this-is-page.html
RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s/+view\.php\?([^\s]+) [NC]
RewriteCond ^ view/%1? [L,R]
# internal forward from view/2012/this-is-page.html to view.php?2012/this-is-page.html
RewriteCond ^view/(.+)$ view.php?$1 [L,NC,QSA]