【发布时间】:2015-08-14 10:35:09
【问题描述】:
我需要这个网址:
www.99bankinfo.in/index.php?bank=AxisBank
到
www.99bankinfo.in/AxisBank
但看起来是这样的:
www.99bankinfo.in/AxisBank%20HTTP/1.1/
我的 .htaccess 代码:
Options +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond $1 !^(index\.php|robots\.txt)
RewriteRule ^(.*)$ index.php?/$1 [L]
# Redirect non-www to www
RewriteCond %{HTTP_HOST} !^www\.(.*)
RewriteRule (.*) http://www.%{HTTP_HOST}/$1 [R=301,L]
RewriteCond %{THE_REQUEST} ^(GET|POST|HEAD)\ /index\.php\?bank=([^&]+)
RewriteRule ^ /%2/? [L,R=301]
请提出任何解决方案,我被困了好几天...... 提前致谢。
【问题讨论】:
标签: php regex apache .htaccess mod-rewrite