Web Hosting Talk







View Full Version : How to map an URL to a file(not folder) with .htaccess~??


Bruce Lee JR
11-19-2009, 02:20 AM
I am trying to map an URL to a specific picture on my account.

My hosting supports .htaccess and I am able to point to folders and whatnot... but I dont know how to point to a FILE such as a picture/jpeg,gif, etc

My website is chartest.comxa.com (free webhosting)

As soon as chartest.comxa.com is entered, I want it to go to chartest.comxa.com/uploadz/a1.jpg

I also need this at the top of my htaccess file "RewriteBase /" because ********** says "We use virtual user home directory paths, so you may get errors when trying to set up search engine friendly URL's"

Is this possible~???


Thanks

HostBill
11-19-2009, 09:46 AM
Try sth like this - not sure if this will work cause dont have much time to test

#RewriteCond %{REQUEST_FILENAME} !-f #add this two above if rewrite rule will not work
#RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule ^(.*)$ /uploadz/a1.jpg[L]