Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/273.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
Php Htaccess重写规则在url末尾添加HTTP/1.1_Php_Regex_Apache_.htaccess_Mod Rewrite - Fatal编程技术网

Php Htaccess重写规则在url末尾添加HTTP/1.1

Php Htaccess重写规则在url末尾添加HTTP/1.1,php,regex,apache,.htaccess,mod-rewrite,Php,Regex,Apache,.htaccess,Mod Rewrite,我需要这个网址: www.99bankinfo.in/index.php?bank=AxisBank 到 www.99bankinfo.in/AxisBank 但似乎是这样的: www.99bankinfo.in/AxisBank%20HTTP/1.1/ My.htaccess代码: Options +FollowSymLinks RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{RE

我需要这个网址:
www.99bankinfo.in/index.php?bank=AxisBank


www.99bankinfo.in/AxisBank

但似乎是这样的:
www.99bankinfo.in/AxisBank%20HTTP/1.1/

My.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]
请提出任何解决方案,我已经好几天没有工作了。。。
提前感谢。

您需要在上次重定向规则中调整正则表达式:

Options +FollowSymLinks
RewriteEngine On
RewriteBase /

RewriteCond %{THE_REQUEST} ^(GET|POST|HEAD)\ /index\.php\?bank=([^&\s]+)
RewriteRule ^ /%2/? [L,R=301]

# Redirect non-www to www
RewriteCond %{HTTP_HOST} !^www\.(.*)
RewriteRule (.*) http://www.%{HTTP_HOST}/$1 [R=301,L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond $1 !^(index\.php|robots\.txt)
RewriteRule ^(.*)$ index.php?/$1 [L]
在重写重定向规则之前,还要保留重定向规则