How To Fix Mod_rewrite 500 Internal Server Error On .htaccess File Apache

Forums » Linux Systems » How To Fix Mod_rewrite 500 Internal Server Error On .htaccess File Apache
instruction to show you step by step on how to fix a 500 error on your browser when you are using apache mod rewrite for linux using the shell terminal commands
ok, so today, i wanted to start making my urls more search engine friendly (SEO), i wrote my .httaccess file and made the changes on my files to make sure the urls are as i put them in the .htacess file. when i tried to open my urls, i kept getting this Apache 500 error:



CODE:
Internal Server Error

The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, webmaster @example.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.

Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.
Apache/2.2.0  Server at thisdomain.com Port 80


I remember a whie back ago i got this same error on another apache server. so what i had to do was look at the /etc/httpd/conf/httpd.conf file make sure i uncomment the mod_rewrite, so i logged into the linux shell and opened the httpd.conf file:

CODE:
nano /etc/httpd/conf/httpd.conf

When i open it, found that the mod_rewrite was not commented out, so wha else could be the problem, as you can see,
LoadModule rewrite_module modules/mod_rewrite.so the is not commented out in the httpd.conf file:


CODE:

LoadModule speling_module modules/mod_speling.so
LoadModule userdir_module modules/mod_userdir.so
LoadModule alias_module modules/mod_alias.so
LoadModule rewrite_module modules/mod_rewrite.so
LoadModule proxy_module modules/mod_proxy.so
LoadModule proxy_balancer_module modules/mod_proxy_balancer.so
LoadModule proxy_ftp_module modules/mod_proxy_ftp.so
LoadModule proxy_http_module modules/mod_proxy_http.so
LoadModule proxy_connect_module modules/mod_proxy_connect.so


so what else could be the problem i wondered...
Then i checked for AlloweOverride :

CODE:
<Directory />
    Options FollowSymLinks
    AllowOverride None
</Directory>


I changed AllowOverride from None to All, rebooted the server and i still kept getting the 500 error. at this point i was breaking my head..
so i checked my .htaccess file again to make sure i didn't make a typo or something, so this is how my .htacces files looks like:

CODE:
Options +FollowSymLinks
RewriteEngine on
RewriteRule ^p-([0-9]*).html viewpage.php?id=$1


So i removed the Options +FollowSymLinks then uploaded it my site, and voala! i didn't get the error anymore. so this is how my .htaccess file looks like now:

CODE:
RewriteEngine on
RewriteRule ^p-([0-9]*).html viewpage.php?id=$1


Thanks to the support team at www.webune.com for helping me with this problem, i had read a post regarding this on this fourm but could not get a resolution on the problems.

Thanks Webune for your support on my dedicated server. - that's what i call service.
Tanuja
thanks a lot for this post. really helped.
teo
you saved my day!!!!!
thanks a lot!!!
RnS
i did same changes above but it did not worked for me....:(
Christian
bit of a bandaid solution eh? great for the people who do not want to use the followsymlinks option, but what about the people that do?
naryano
thank u very match

i maked that on my web site and now working fine

fnon-des
Christoph
you have to enable overriding: "allowoverride all" in your apache configuration for the respective domain to fix the problem.
naryano
thank u very match

i maked that on my web site and now working fine

www.fnon-des.
Khaled
thankssssssssssssssss
Dani
fantastic solution!

thank you so very much from barcelona,spain ;)
50742k
great!!! so much thanks and greetings from mexico city, but i have one more trouble, rewrite doesn't work :'(

it redirect me at 404 page :(

my .htaccess code is:


rewriteengine on
rewriterule ^profile/(.*)$ profile.php?dirid=$1 [l,nc]
Jennifer
seems to have worked! your awesome!
vbulletins
i have htaccess file gives internal error 500 vbulletin forums can you help
nboarch
hello i was attempting to use mod rewrite on uniserver but got 500 internal server error does that mean my apache mod re write module is not working for me. and how do i need to install it to fix this proble?
chami
nice & clear article.helped me to solve my problem
mystix2112
the perblerm is permisson or the perl is
not running right if you are using perl
the scripts will no load read /var/
is where the log are
Live
didn't work for me, i did in the default file
allowoverride all

Jitin
hi, i am facing this problem frm long time but now it is working fine..thanks for your help and support..

web-development-se
vanessa
i dont get it!when i go to myspace home it says 'sorry please try again' and it says 500 Internal Server Error
website
I`ve read few of articles here and could say it was really interesting, thanks for sharing that.
Gal
Thank you. It solved my issue.
Ashish
Hello When i am going for any thing edit in htaccss . It reflects same 500 internal server errir.
Kai
Thanksss..!! You save my day~!!!
purity
mine is that when i load my site url, it gives me a blank page??????? How can i resolve this
http://wallpaperama.com/forums/how-to-fix-mod-rewrite-500-internal-server-error-on-htaccess-file-apache-t718.html
abir
That's so interesting , but when i modified the config file, my server still off line !!! i couldn't restart it !!
Rodrigo
Thanks heaps mate! I was almost banging my head on the desk when your advice came and saved the day.
Cheers
Vítor
Thanks! I solve a lot of thinks with this!
zake
can u bring me a detail of this tutorial ?
please,,, because I am newbie ... :D
Nat4an
i tried what you did and i didn't have to remove my Options +FollowSymLinks from my htaccess file. My fix was I had an auth script in my htaccess, cause i have a project that I want password protected.so i commented that out and it works! But thanks for the tip so that i could fix it. :) kudos
olos
it was SOOOO SIMPLE just to uncomment one line... I spent hours trying to fix it... Thanks!
Janeth
Thank you very much, your comments about Error 500 helped me to resolve my problem with Prestashop and Apache Server, God bless you.
Title: How To Fix Mod_rewrite 500 Internal Server Error On .htaccess File Apache [2877]
Tags: how to fix mod rewrite 500 internal server error on htaccess file apache