StaticVariable
StaticVariable

Reputation: 5283

how to use mod_rewrite with godaddy

I am using godaddy linux shared hosting and i am having some problem with mod_rewrite. I am not much familier with mod_rewrite my code is

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^\.]+)$ $1.php [NC,L] 
RewriteRule readfile.php(.*)$ seceretfile.php?$1 [L,QSA]

this code works file on my localhost but online it doesn't work when i go to readfile.php it shows file not found AND also when i type a file without .php extension it shows an error?

Upvotes: 1

Views: 194

Answers (1)

StaticVariable
StaticVariable

Reputation: 5283

After some research i found a solution

Options +FollowSymlinks -MultiViews
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^\.]+)$ $1.php [NC,L] 
RewriteRule readfile.php(.*)$ lebetafile.php?$1 [L,QSA]

now this code works for me..But a new problem happens that the orignal 404 error file is not working and i don't know about the security risks of this But this is working fine with godaddy

Upvotes: 1

Related Questions