Page 1 of 1

mod_rewrite doesn't work?

PostPosted: 18. December 2011 14:55
by styra01
Hi,
I bought a CMS Design Using PHP and jQuery book to learn something new. In the first pages of book, there is a mod_rewrite code in .htaccess, and looks like this:
Code: Select all
RewriteEngine on
RewriteRule ^([^./]{3}[^.]*)$ /index.php?page=$1 [QSA,L]

Typing localhost/cms/MYWORD in browser doesn't work (404 not found)... When i upload this .htaccess & other cms files on my hosting - everything works fine.
How to set XAMPP mod_rewrite to work properly?

Re: mod_rewrite doesn't work?

PostPosted: 18. December 2011 23:17
by Sharley
Read the \xampp\apache\logs\error.log file for clues about the 404 file not found error.

Re: mod_rewrite doesn't work?

PostPosted: 10. January 2012 22:28
by Kiseki
Hi,

I am having the same problem, did you manage to figure out what the issue was?

I get the following error in the Apache log;

"script 'C:/****/*****/******/******/Test Server/index.php' not found or unable to stat"

Thanks in advance.

Re: mod_rewrite doesn't work?

PostPosted: 10. January 2012 22:34
by Kiseki
I just solved the issue by doing the following;

"Rewriting in Virtual Hosts

By default, mod_rewrite configuration settings from the main server context are not inherited by virtual hosts. To make the main server settings apply to virtual hosts, you must place the following directives in each <VirtualHost> section:


RewriteEngine On
RewriteOptions Inherit
"