Apache Server configuration support - mod_rewrite Help

This is Interesting: Free IT Magazines  
Home > Archive > Apache Server configuration support > December 2005 > mod_rewrite Help





You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

Author mod_rewrite Help
trevordixon@gmail.com

2005-12-28, 9:01 pm

I'm trying to configure Apache so that I can use mod_rewrite. I
uncommented these lines in httpd.conf:

LoadModule rewrite_module modules/mod_rewrite.so
AddModule mod_rewrite.c

Then I added the following:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^page([^/]*)\.html$ /test.php?filename=page&pageid=$1
RewriteRule ^([^/]*)\.html$ /test.php?filename=$1 [L]
</IfModule>

Should I expect "index.html" to take me to "test.php?filename=index"?
What am I doing wrong?

Trevor

Robert Ionescu

2005-12-28, 9:01 pm

trevordixon@gmail.com wrote:
> Then I added the following:
>
> <IfModule mod_rewrite.c>
> RewriteEngine On
> RewriteRule ^page([^/]*)\.html$ /test.php?filename=page&pageid=$1
> RewriteRule ^([^/]*)\.html$ /test.php?filename=$1 [L]
> </IfModule>


In per-server context, the pattern of the RewriteRule (left side) start
with a leading slash. If your filename/id does not include any literal
periods, exclude them from the regular expression for performance issues:

RewriteEngine On
RewriteRule ^/page([^/.]*)\.html$ /test.php?filename=page&pageid=$1 [L]
RewriteRule ^/([^/.]+)\.html$ /test.php?filename=$1 [L]

--
Robert
Sponsored Links






Free braindumps | Software forum | Database administration forum

Copyright 2003 - 2008 webservertalk.com