Forum Moderators: phranque

Message Too Old, No Replies

Another mod rewrite question - XAMPP

         

tomhumf

11:01 pm on Feb 19, 2009 (gmt 0)

10+ Year Member



Hi,

After following the excellent example by jdMorgan

[webmasterworld.com...]

I have a .htaccess file that works:

# Enable mod_rewrite, start rewrite engine
Options +FollowSymLinks
RewriteEngine on
#
# Internally rewrite search engine friendly static URL to dynamic filepath and query
RewriteRule ^product/([^/]+)/([^/]+)/([^/]+)/?$ /product.php?p=$1&id=$2&t=$3 [L]

So first of all, thanks JD for the post, I have tried unsuccessfully to do this before.

I tried loading my site in XAMPP with the new .htaccess file in place and it gave an error. With the .htaccess moved it started working again. I can understand that it would cause problems, but are there any ways to use something like XAMPP whilst testing mod_rewrite files?

Thanks

jdMorgan

11:12 pm on Feb 19, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



What kind of error, specifically?

What do you see in your server error log file?

XAMPP is just a "package" of Apache, MySQL, PHP, PERL, and some other stuff, so the question sort of resembles asking, "Can I use Apache while testing .htaccess?" As a result, it's confusing... :(

The problem is likely just a basic server config problem, though.

Jim

tomhumf

5:31 pm on Feb 27, 2009 (gmt 0)

10+ Year Member



Hi,

The error I get is below. Just to reiterate, the .htaccess file is working fine on my server, I only encounter this error when using XAMPP.

Thanks
....................................................................
Server error!

The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there was an error in a CGI script.

If you think this is a server error, please contact the webmaster.
Error 500
127.0.0.1
02/27/09 09:29:11
Apache/2.2.8 (Win32) DAV/2 mod_ssl/2.2.8 OpenSSL/0.9.8g mod_autoindex_color PHP/5.2.5

.................................................................

I just found this in my XAMPP error log file too:

...............................................................

Invalid command 'RewriteEngine', perhaps misspelled or defined by a module not included in the server configuration

g1smd

7:46 pm on Feb 27, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



You'll need to enable Mod_Rewrite by editing the server httpd.conf file.

tomhumf

6:38 pm on Feb 28, 2009 (gmt 0)

10+ Year Member



O.k thanks I've found this line in the httpd.conf

#LoadModule rewrite_module modules/mod_rewrite.so

I tried just taking the # off the front and refreshing the page but it is still giving the error.

Is there something else I need to do?

g1smd

7:35 pm on Feb 28, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Yes, there's usually two lines to uncomment around here.

g1smd

7:36 pm on Feb 28, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



../.