我试图在.htaccess中创建SEO友好的蒙面重写。 htaccess文件在localhost和我的个人服务器上工作正常,但不幸的是在GoDaddy的服务器上不起作用。我知道那已经是一个问题了,但是正在为使用Godaddy作为主持人的客户工作。.htaccess将查询字符串附加到内部重定向
问题是,重写似乎强制重定向显示浏览器URL栏中重写的查询字符串,而不是将其保留在内部。 例如。
规则:
RewriteRule ^/?([a-zA-Z0-9-_/]*)$ /index.php?loadPage=$1&mode=cms [L,QSA]
链接:/images
重定向到/images/?loadPage=images&mode=cms
这个“应该”留为/images/
的浏览器。我抄我的短低于.htaccess
,修改为开发区块
<Files .htaccess>
deny from all
</Files>
Options -MultiViews +FollowSymlinks -Indexes
RewriteEngine On
RewriteBase/
# Stop Old redirection from block below
RewriteCond %{REQUEST_URI} "/old/"
RewriteRule (.*) $1 [L]
# Under construction Redirect
RewriteCond %{REMOTE_ADDR} !^0.0.0.0
RewriteCond %{REQUEST_URI} !^/?old/
RewriteRule ^/?(.*) “/old/$1″ [L,QSA]
#Admin utilities rewrite
RewriteRule ^/?admin/?(.*)$ /index.php?loadPage=$1&mode=backend [L,QSA]
#CMS/Frontend rewrites -- this one is failing
RewriteRule ^\/?([a-zA-Z0-9-_]+)\/?$ /index.php?loadPage=$1&mode=cms [QSA,L]
IP地址
潜在笔记的提示是,所显示的网址是/images/?query_string
,NOT index.php?query_string
,所以它不是做了充分的重定向,尽管外部请求被接受来自页面请求的301响应。
请参考以下链接或者你也可以contect支持团队http://support.godaddy.com/groups/web-hosting/forum/topic/problem-using-htaccess-for-url-rewrite/和http://support.godaddy.com/groups/web-hosting/forum/topic/how-do-i-use-htaccess-to-redirect-my-document-root-and-mask-the-url/? sid =&sp = 1 –
感谢您的链接,不幸的是我调查了他们两人,似乎都不适用于我的情况。 –