2015-07-21 53 views
0

我看到这个问题在几个网站上提出的解决方案,这似乎并没有为我工作。.htaccess mod_rewrite.c删除php扩展不能在godaddy服务器上工作

我试图把somesite.com/services.php成somesite.com/services

我的.htaccess:

<IfModule mod_rewrite.c> 
Options -MultiViews 
RewriteEngine On 
RewriteCond %{REQUEST_FILENAME}.php -f 
RewriteCond %{REQUEST_URI} !/$ 
RewriteRule ^(.*)$ $1\.php 
</IfModule> 

加入

Options -MultiViews 

是最人民解决问题的办法。这对我不起作用。

这寻找我services.php文件时,看到的就是目录位置复制路径。com的

/somesite.com/somesite.com/services.php 

The requested URL /somesite.com/somesite.com/services.php was not found on this server. 

后创建一个问题,我有一种感觉,这是一个简单的解决。我希望stackoverflow军队可以纠正我的错误。

谢谢。

回答

0

使用本

<IfModule mod_rewrite.c> 

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

</IfModule> 

和可能的htaccess not working on godaddy

+0

这已经得到了我一点点接近重复“的请求的URL /somesite.com/services此服务器上找到。”显示它现在正在查找没有.php文件的文件? – jjonesdesign

相关问题