Mod rewrite question

Whether you are using Linux on the desktop or as a server, it's still good that you're using Linux. Linux related questions go here.

Moderator: General Moderators

Post Reply
GeXus
Forum Regular
Posts: 631
Joined: Sat Mar 11, 2006 8:59 am

Mod rewrite question

Post 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]
 
User avatar
s.dot
Tranquility In Moderation
Posts: 5001
Joined: Sun Feb 06, 2005 7:18 pm
Location: Indiana

Re: Mod rewrite question

Post 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
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
Post Reply