Page 1 of 1

Mod rewrite question

Posted: Mon Feb 11, 2008 12:21 pm
by GeXus
I have the following mod rewrite code... however, it's not working as expected.

If I add a / after (.*) it works, but without it it, it's causing the a value to be set to index.php, always. Does anyone know how I can fix this without having to have the ending forward slash? Thanks!

Code: Select all

 
Options +FollowSymlinks
RewriteEngine on
RewriteRule ^games/(.*) games/index.php?a=$1 [nc]
 

Re: Mod rewrite question

Posted: Mon Feb 11, 2008 1:11 pm
by s.dot
GeXus wrote:I have the following mod rewrite code... however, it's not working as expected.

If I add a / after (.*) it works, but without it it, it's causing the a value to be set to index.php, always. Does anyone know how I can fix this without having to have the ending forward slash? Thanks!

Code: Select all

 
Options +FollowSymlinks
RewriteEngine on
RewriteRule ^games/(.*) games/index.php?a=$1 [nc]
 

Code: Select all

RewriteRule ^games/(.+)(/)?$ games/index.php?a=$1