Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/.htaccess/6.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 301重定向不起作用_.htaccess_Redirect_Mod Rewrite - Fatal编程技术网

.htaccess htaccess 301重定向不起作用

.htaccess htaccess 301重定向不起作用,.htaccess,redirect,mod-rewrite,.htaccess,Redirect,Mod Rewrite,HT301重定向的访问权限: RewriteEngine on Redirect 301 /page.asp?DH=35 http://www.domain.ch/karriere HTACCESS代码(稍后在HTACCESS文件中),用于获取有关永久链接的信息 <IfModule mod_rewrite.c> RewriteEngine on RewriteBase / <FilesMatch "\.(htm|php|js|css|htc|png|gif|jp

HT301重定向的访问权限:

 RewriteEngine on
 Redirect 301 /page.asp?DH=35 http://www.domain.ch/karriere
HTACCESS代码(稍后在HTACCESS文件中),用于获取有关永久链接的信息

 <IfModule mod_rewrite.c>
 RewriteEngine on
 RewriteBase /

 <FilesMatch "\.(htm|php|js|css|htc|png|gif|jpe?g|ico|xml|csv|txt|swf|flv|eot|woff|svg|ttf|pdf|gz)$">
RewriteEngine Off
</FilesMatch>

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php?catslugs=$0 [QSA,L]

</IfModule>

重新启动发动机
重写基/
发动机熄火
重写cond%{REQUEST_FILENAME}-F
重写cond%{REQUEST_FILENAME}-D
重写规则。*index.php?catslugs=$0[QSA,L]
不幸的是,301无线电无法工作。有什么不对,有什么建议吗


谢谢

查询\u无法使用
重定向
指令匹配字符串
。您需要在mod_rewrite中使用
RewriteCond
。这样做:

RewriteEngine on
RewriteBase /

RewriteCond %{QUERY_STRING} (^|&)DH=35(&|$) [NC]
RewriteRule ^page\.asp$ http://www.domain.ch/karriere? [L,NC,R=301]

<FilesMatch "\.(htm|php|js|css|htc|png|gif|jpe?g|ico|xml|csv|txt|swf|flv|eot|woff|svg|ttf|pdf|gz)$">
RewriteEngine Off
</FilesMatch>


RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php?catslugs=$0 [QSA,L]

</IfModule>
重新编写引擎打开
重写基/
RewriteCond%{QUERY_STRING}(^ |&)DH=35(&|$)[NC]
重写规则^page\.asp$http://www.domain.ch/karriere? [L,NC,R=301]
发动机熄火
重写cond%{REQUEST_FILENAME}-F
重写cond%{REQUEST_FILENAME}-D
重写规则。*index.php?catslugs=$0[QSA,L]

感谢您的快速回答。它工作得很好。但是另一个问题,对于搜索引擎优化或者谷歌来说,这和301永久重定向是一样的吗?对不起,请看代码里面的信息。该睡觉了;-)