Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

.htaccess file is not working on go daddy server

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
like image 881
Ahsan aslam Avatar asked Jan 17 '23 07:01

Ahsan aslam


1 Answers

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]
like image 199
Ahsan aslam Avatar answered Jan 28 '23 12:01

Ahsan aslam