htaccess的不工作的GoDaddy的 [英] htaccess not working on godaddy

查看:443
本文介绍了htaccess的不工作的GoDaddy的的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近搬到了GoDaddy的和的.htaccess似乎并没有工作。是否有这需要GoDaddy的工作要做,因为的.htaccess正在研究previous举办任何设置。我曾尝试使用搜索功能,但遗憾的是仍然不能得到它的工作。以下是的.htaccess文件目前在父目录我的code。我注意到一些人说,这需要3个小时的效果发生。但是,它已经现在已经几个星期,但仍然没有好。

 选项+了FollowSymLinks
RewriteEngine叙述上
重写规则^ work.html work.php
重写规则^ about.html about.php
重写规则^ services.html services.php
重写规则^的index.html的index.php
重写规则^ contact.html contact.php
 

解决方案

尝试禁用<一个href="http://httpd.apache.org/docs/current/mod/mod_negotiation.html#multiviews"><$c$c>multiviews其中是在GoDaddy的通过默认。如果还是不行,请尝试在的.htaccess 设置一个环境变量,看看你是否可以通过PHP访问:

 选项+了FollowSymLinks -Multiviews

&LT; IfModule mod_rewrite.c&GT;

    SETENV HTTP_MOD_REWRITE在
    RewriteEngine叙述上
    的RewriteBase /
    的RewriteCond%{REQUEST_URI}([^。] +)。HTML $
    重写规则^ *%1.PHP [L]

&LT; / IfModule&GT;
 

另存为像 modRewrite_check.php

 &LT; PHP

 如果(!空($ _ SERVER ['HTTP_MOD_REWRITE'])){
     回声mod_rewrite的运行;
 } 其他 {
     回声mod-rewrite没有运行;
 }

?&GT;
 

I recently moved to godaddy and the .htaccess doesn't seem to work. Are there any settings which need to be done for godaddy because the .htaccess was working on previous hosting. I have tried to use the search feature but unfortunately couldn't still get it to work. Following is my code of .htaccess the file is currently in the parent directory. I noticed some people saying that it takes 3 hours for the effect to take place. But it has already been a few weeks now but still no good.

Options +FollowSymLinks
RewriteEngine on
RewriteRule ^work.html work.php
RewriteRule ^about.html about.php
RewriteRule ^services.html services.php
RewriteRule ^index.html index.php
RewriteRule ^contact.html contact.php

解决方案

Try to disable multiviews which are on in GoDaddy by default. If that doesn't work, then try to set an environment variable in .htaccess and see if you can access it via PHP:

Options +FollowSymLinks -Multiviews

<IfModule mod_rewrite.c>

    SetEnv HTTP_MOD_REWRITE On
    RewriteEngine on
    RewriteBase /
    RewriteCond %{REQUEST_URI} ([^.]+).html$
    RewriteRule ^.* %1.php [L]

</IfModule>

Save this as something like modRewrite_check.php:

<?php

 if(!empty($_SERVER['HTTP_MOD_REWRITE'])){
     echo "Mod_Rewrite is running";
 } else {
     echo "Mod Rewrite is not running";
 }

?>

这篇关于htaccess的不工作的GoDaddy的的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆