simple image redirect

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

simple image redirect

Postby computer » Sat Jul 10, 2004 10:30 am

hi,

I'm having real big trouble here. Here is what I want:

all things to serve.mydomain.com/02.png or serve.mydomain.com/02 to go to serve.mydomain.com/index.php?id=02

I don't understand how to do that though, and it doesnt seem to work when I try different peoples ideas on these forums and around the internet.

My latest try was:
Code: Select all
RewriteEngine On
RewriteBase /
RewriteRule ^serve/(.*)\.png$ index.php?id=$1

and
Code: Select all
RewriteEngine On
RewriteBase /
RewriteRule ^([0-9]+)\.png index.php?id=$1


this .htaccess file is in the serve.mydomain.com directory, not the root directory.

PS: you can also access it at mydomain.com/serve/ but I want the subdomain to work.

I can put these in the .htaccess in the root directory if it will work better.

Thanks,
computer
computer
 

Return to Beginner's Corner

Who is online

Users browsing this forum: No registered users and 114 guests

cron