Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/apache/8.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
GoDaddy Apache 2.4-301 htacces重定向_Apache_.htaccess_Mod Rewrite - Fatal编程技术网

GoDaddy Apache 2.4-301 htacces重定向

GoDaddy Apache 2.4-301 htacces重定向,apache,.htaccess,mod-rewrite,Apache,.htaccess,Mod Rewrite,在他们更新服务器之前,我有一个完美的工作站点,现在我无法让重定向正常工作 这就是我以前的经历: RewriteEngine On rewritecond %{http_host} ^site.com [nc]<br/> rewriterule ^(.*)$ http://www.site.com/$1 [r=301,nc]<br/> redirect 301 "contact.html" http://site.com/contact.php<br/> 重新

在他们更新服务器之前,我有一个完美的工作站点,现在我无法让重定向正常工作

这就是我以前的经历:

RewriteEngine On
rewritecond %{http_host} ^site.com [nc]<br/>
rewriterule ^(.*)$ http://www.site.com/$1 [r=301,nc]<br/>
redirect 301 "contact.html" http://site.com/contact.php<br/>
重新编写引擎打开
重写cond%{http_host}^site.com[nc]
重写规则^(.*)$http://www.site.com/$1[r=301,nc]
重定向301“contact.html”http://site.com/contact.php

请帮忙

在所展示的示例中有HTML标记。此外,你还用不必要的引号来描述事物。现在只使用
mod_rewrite

RewriteEngine On
RewriteRule ^contact.html http://www.site.com/contact.php [R=301,L]

RewriteCond %{HTTP_HOST} ^site.com [NC]
RewriteRule ^(.*)$ http://www.site.com/$1 [R=301,NC,L]
请记住,由于GoDaddy是主机,因此它们将在其
httpd.conf
文件中处理指令以及您在
.htaccess
文件中添加的任何配置


如果出于某种原因,这不起作用,另外还用于处理服务配置中的问题。

是的,没有帮助,除了指向Apache 2.4文档的链接之外,他们是否启用了htaccess?