Php .htaccess url重写不会返回整个url
.h我使用的访问规则-Php .htaccess url重写不会返回整个url,php,regex,apache,Php,Regex,Apache,.h我使用的访问规则- RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^([^/\.]+)/?$ profile.php?user=$1 [L] RewriteRule ^(.*)$ profile.php?user=$1 [QSA,NE] 正确示例- http://mydomain.com/http://fatalweb.com/art
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/\.]+)/?$ profile.php?user=$1 [L]
RewriteRule ^(.*)$ profile.php?user=$1 [QSA,NE]
正确示例-
http://mydomain.com/http://fatalweb.com/articles/8/definitions-for-htaccess-regex-character
传递给$1的值是-http://fatalweb.com/articles/8/definitions-for-htaccess-regex-character
http://mydomain.com/https://www.google.com/search?q=_get&ie=utf-8&oe=utf-8&aq=t
传递给$1的值是-https:/www.google.com/search
如何确保整个url
https://www.google.com/search?q=_get&ie=utf-8&oe=utf-8&aq=t
以及所有查询参数都被传递到$1在您的问题中,是不是https:/www.google.com/search
?https://
后缺少一个斜杠
在使用空文件处理程序之前,至少需要指定一条规则。不知道为什么,但这就是它的工作原理。请针对您的用例查看以下内容:
RewriteEngine On
RewriteRule ^([^/]*)\.dummy$ ./?dummy=$1&%{QUERY_STRING} [L]
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteRule ^(.*)$ ./%{QUERY_STRING}
行RewriteRule^([^/]*)\.dummy$./?dummy=$1&%{QUERY\u STRING}[L]
是空的。检查并看看这是否对您有效!:)