.htaccess causes Internal Server Error
Posted by: vinTage (---.access.telenet.be)
Date: August 16, 2006 09:08PM

Hello, first I would like to say that I really am impressed how smooth the install went and how everything else works like a charm !

Im working on my first little project with a htaccess file, all the files works fine and works perfect with making "good links" on my payed host
like
site.com/?page=smth$id=4
will be
site.com/smth/4/

However, if I test the exact same files on my localhost it results in an Internal Server Error

this is in the htaccess that is in the folder where I putted al the other files
(C:/wamp/www/test => in the directory "test" is the index, some other files and the htacces)
RewriteEngine On
RewriteRule ^(.*)/(.*)/ index.php?pagina=$1&id=$2
RewriteRule ^([a-zA-Z0-9_-]+)/$ index.php?pagina=$1

anyone knows what is wrong ?

thx in advance


Options: ReplyQuote
Re: .htaccess causes Internal Server Error
Posted by: CyberSpatium (67.170.181.---)
Date: August 17, 2006 04:05AM

make sure you enable mod_rewrite in your httpd.conf file.

Options: ReplyQuote
Re: .htaccess causes Internal Server Error
Posted by: vinTage (---.access.telenet.be)
Date: August 18, 2006 12:29AM

thx for your reply CyberSpatium, ive searched for mod_rewrite in the httpd.conf en uncommented this line ;
AddModule mod_rewrite.c

there were just 2 lines with "mod_rewrite, the other one was this;
LoadModule rewrite_module modules/mod_rewrite.so

when I look at the site now it doesnt give me an Internal Server Error anymore, but when I click on the link thats shown in the default wamp index it gives me a Bad Request, when i put a slash behind the url its okay.
however i would like to make use of "fancy urls" made by htaccess on my local host. these work on my payed host, but not local....

HELP !! smiling smiley

Options: ReplyQuote
Re: .htaccess causes Internal Server Error
Posted by: CyberSpatium (67.170.181.---)
Date: August 18, 2006 08:42AM

go back and put the comment back on this line
AddModule mod_rewrite.c

save the file and then restart apache. any time you edit your httpd.conf or php.ini file,you need to restart apache for your new settings to take effect.

Options: ReplyQuote
Re: .htaccess causes Internal Server Error
Posted by: matth2004 (---.people.net.au)
Date: August 18, 2006 10:53AM

Another way to add support for mod_rewrite is to just find the rewrite selection when you click on the wamp taskbar icon and then go to Apache Modules.

Options: ReplyQuote
Re: .htaccess causes Internal Server Error
Posted by: matth2004 (---.people.net.au)
Date: August 18, 2006 10:56AM

Also, put at the top of your file:

+FollowSymLinks

This is also needed on some servers for the rewrite rule to work along with Rewrite engine on.

Options: ReplyQuote


Sorry, only registered users may post in this forum.