.htaccess file is not working on go daddy server

不打扰是莪最后的温柔 提交于 2019-12-07 08:38:52

问题


I have a website that is hosted on Godaddy server. For SEO I have made all the rule free from .php extension. for url rewrite i am using .htaccess file

.htaccess file is running fine on local server that is XAMPP, but on live server (godaddy server ) it is not working.

I have no idea about .htaccess file code

.htaccess file content is

RewriteEngine On
Options +MultiViews

回答1:


i have found answer myself

Options +FollowSymLinks -MultiViews 
# Turn mod_rewrite on
RewriteEngine On
RewriteBase /

## hide .php extension
# To externally redirect /dir/foo.php to /dir/foo
RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s([^.]+)\.php [NC]
RewriteRule ^ %1 [R,L,NC]

## To internally redirect /dir/foo to /dir/foo.php
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^ %{REQUEST_URI}.php [L]



回答2:


Maybe # there is a issue with directory settings, try placing a empty .htaccess file with RewriteEngine # or it's because of GoDaddy's setup. add Apache httpd.conf file: AllowOverride FileInfo Options" file to root directory.



来源:https://stackoverflow.com/questions/11151357/htaccess-file-is-not-working-on-go-daddy-server

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!