Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/.htaccess/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
.htaccess htaccess重写与godaddy_.htaccess_Mod Rewrite - Fatal编程技术网

.htaccess htaccess重写与godaddy

.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_

正在尝试我的.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_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]