• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

mod_rewrite [RESOLVED]

LeetestUnleet

Senior member
I need the following requested (example) URL:
http://domain.com/5

To transparently redirect to:
http://domain.com/index.php?id=5

index.php is currently just outputting a print_r($_GET).

Below is the contents of the localized .htaccess file:

Options +FollowSymLinks
RewriteEngine on
RewriteBase /aaronb/temp

RewriteRule ^(.*)/ index.php?id=$1 [L]
RewriteRule ^(.*) index.php?id=$1 [L]

Instead of index.php outputting
Array ( [id] => 5 )

It's outputting
Array ( [id] => index.php )



I know there's something wrong with my Regex, but I don't understand it well enough to fix it. Any thoughts?
 
Nice! That cheat sheet helps a lot.

For reference, if anyone comes across this in a search later, this is the working .htaccess


Options +FollowSymLinks
RewriteEngine on
RewriteBase /aaronb/temp

RewriteRule ^([0-9]+)/?$ index.php?id=$1
 
Back
Top