friendly URL

New to mod_rewrite? This is a good place to start.

friendly URL

Postby danny » Sat Mar 10, 2007 9:13 pm

I am looking to make a page, where if is called, that is displayed, yet if is called, the page is displayed.

The mod rewrite code that I've tried for this is:
Code: Select all
RewriteRule ^(.+)$ /index.php?ID=$1

This however is redirecting the page to, and if I go to, it causes the page not to redirect properly.

Any help is much appreciated.

Never mind, I eventually found it:
Code: Select all
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteRule ^([^/]+)/?$ /index.php?ID=$1 [QSA,L]
Posts: 2
Joined: Sat Mar 10, 2007 8:43 pm

Return to Beginner's Corner

Who is online

Users browsing this forum: No registered users and 6 guests