Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/.htaccess/5.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
.htaccess 使用htaccess重定向带有查询的特定页面_.htaccess_Redirect - Fatal编程技术网

.htaccess 使用htaccess重定向带有查询的特定页面

.htaccess 使用htaccess重定向带有查询的特定页面,.htaccess,redirect,.htaccess,Redirect,比如说 mydomain.com/jobresultpage?what=&where=阿肯色州 重定向到 yourdomain.com/jobresultpage?what=&where=阿肯色州 但另一页像 mydomain.com/about.html mydomain.com/contact.html 不重定向..尝试将以下规则添加到位于mydomain.com的根目录中的.htaccess文件中 RewriteEngine On RewriteBase / RewriteCond %{

比如说

mydomain.com/jobresultpage?what=&where=阿肯色州

重定向到

yourdomain.com/jobresultpage?what=&where=阿肯色州

但另一页像

mydomain.com/about.html

mydomain.com/contact.html


不重定向..

尝试将以下规则添加到位于
mydomain.com的根目录中的.htaccess文件中

RewriteEngine On
RewriteBase /

RewriteCond %{HTTP_HOST} mydomain\.com$ [NC]
#redirect any request for jobresult to yourdomain
RewriteRule ^jobresultpage$ http://yourdomain.com%{REQUEST_URI} [NC,L,R=301]

确保安装了mod_rewrite,并将覆盖属性设置为读取.htaccess文件。