php redirection using mod_rewrite

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

php redirection using mod_rewrite

Postby Guest » Thu May 13, 2004 7:49 am

Using php and apache's mod_rewrite, I'm trying to get my small redirection script to work. It works like this:
the folder foo (the absolute URL is thus http://example.com/foo) contains the file index.php, this allows me to have URLs that look like this:
foo/?url=a_good_site
but this looks quite ugly, so I tried to get URLs like this one
foo/a_good_site
instead. I use the following apache code:
Code: Select all
RewriteCond %{QUERY_STRING} ^url=([^&]+)$
RewriteRule foo/index.php foo/%1 [L]

But it simply doesn't work. Any ideas?
Guest
 

Return to Beginner's Corner

Who is online

Users browsing this forum: No registered users and 22 guests

cron