Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/regex/20.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
Regex htaccess重写规则仅为查询字符串的一部分_Regex_Apache_.htaccess_Mod Rewrite - Fatal编程技术网

Regex htaccess重写规则仅为查询字符串的一部分

Regex htaccess重写规则仅为查询字符串的一部分,regex,apache,.htaccess,mod-rewrite,Regex,Apache,.htaccess,Mod Rewrite,我需要这样的请求: www.mydomain.com/books/catalog.html?param1=abc&param2=123param3=etc 要在内部重写,以便从以下位置提供内容: www.mydomain.com/index.php?page=books/catalog.html&param1=abc&param2=123&param3=etc 将此代码放入文档\u ROOT/.htaccess文件: RewriteEngine On Rew

我需要这样的请求:

www.mydomain.com/books/catalog.html?param1=abc&param2=123param3=etc
要在内部重写,以便从以下位置提供内容:

www.mydomain.com/index.php?page=books/catalog.html&param1=abc&param2=123&param3=etc

将此代码放入
文档\u ROOT/.htaccess
文件:

RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.+)$ /index.php?page=$1 [L,QSA]

冠军-这是一种享受,谢谢!(只是注意到我需要更多的声誉才能投票支持你,但答案被接受)很高兴这一切顺利。接受度很好,尽管现在你有足够好的声誉去投票:)