Click to See Complete Forum and Search --> : Problem about install mod_rewriter


gop373
11-22-2005, 12:12 PM
This is the first time that I use mod_rewrite .......I have question about install mod_rewrite. I php and Apache and run locally on my window xp. My question is that I install Apache_2.0.55-win32-x86-no_ssl I read from most tutorial it said

Uncomment LoadModule rewrite_module modules/mod_rewrite.so and AddModule mod_rewrite.c. The problem is when I open httpd.cofg, I don't have AddModule mod_rewrite.c. so what should I do....I tried to add AddModule mod_rewrite.c. But that cause server can not run.

What should I do any comment.

Scleppel
11-22-2005, 01:16 PM
I don't think the "AddModule" line matters if you don't already have it, neither of my installs have any "AddModule" lines (i have mod_rewrite enabled on both).

gop373
11-22-2005, 08:36 PM
So what should I do next ?????
I created the .htaccess file in this path C:\Program Files\Apache Group\Apache2\htdocs\.htaccess is it the right place ??? My actual project is in this path C:\Test\Ass\mark.php.

in .htaccess i wrote
RewriteEngine on
RewriteRule ^Ass/mark/([0-9]+)$ /Ass/mark.php?GroupID=$1 [L]

Then restart Apache.......But the problem is when I open file php.....it still shows http://localhost/Ass/mark.php?ID=1

Do I miss anything.....what should I do any comment !!! :confused: :(

bokeh
11-23-2005, 12:52 PM
.htaccess generally goes in the root directory but can also go in sub directorys if it is only to affect that directory and its desendents. A server restart is not required after changes to .htaccess.

SpectreReturns
11-24-2005, 12:07 AM
Put the lines into your httpd.conf to make the global changes required for most mod_rewrite stuff.

gop373
11-24-2005, 03:27 AM
You mean put this line
RewriteEngine on
RewriteRule ^Ass/mark/([0-9]+)$ /Ass/mark.php?GroupID=$1 [L]

in httpd.conf ????

bokeh
11-24-2005, 04:18 AM
You mean put this line
RewriteEngine on
RewriteRule ^Ass/mark/([0-9]+)$ /Ass/mark.php?GroupID=$1 [L]

in httpd.conf ????I wouldn't unless you can think of a good reason. What about when you run the site from an environment where you don't have control over httpd.conf?

The above should work fine but you need to look at your rewrite rule. For example no leading slash.

For excellent info on mod_rewrite there is a forum and website (http://www.doriat.com/) completely devoted to it.