【发布时间】:2015-11-13 21:04:44
【问题描述】:
这是我的 .htaccess 文件。
Options +FollowSymLinks
<IfModule mod_security.c>
SecFilterEngine Off
SecFilterScanPOST Off
</IfModule>
RewriteEngine on
RewriteRule ^index.html /? [R=301,L]
RewriteRule ^listen/$ /console [R=301,L]
# 301 Redirect all requests that don't contain a dot or trailing slash to
# include a trailing slash
RewriteCond %{REQUEST_URI} !/$
RewriteCond %{REQUEST_URI} !\.
RewriteRule ^(.*) %{REQUEST_URI}/ [R=301,L]
# Rewrites urls in the form of /parent/child/
# but only rewrites if the requested URL is not a file or directory
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)$ index.php?page=$1 [QSA]
重写规则
RewriteRule ^listen/$ /console [R=301,L]
将网址www.mydomain.co.uk/listen重定向到www.mydomain.co.uk/console
此重定向工作正常,但我希望地址栏中的可见 url 能够读取...
www.mydomain.co.uk/listen
非常感谢任何帮助。谢谢
【问题讨论】:
-
删除
R=301标志以使其成为RewriteRule ^listen/$ /console [L] -
谢谢。我试过了,但还是不行……
-
清除浏览器缓存。
-
是的,我做了几次,并在不同的浏览器中尝试过
-
是不是因为后面出现了其他重写规则( RewriteRule ^(.*) %{REQUEST_URI}/ [R=301,L] )?我尝试更改顺序,但重定向完全中断
标签: .htaccess url mod-rewrite url-redirection http-redirect