Forum Moderators: phranque
I've made a subdomain using htaccess, and made a directory called "photo", where all the files for the subdomain are to be placed in.. But when I enter the domain and get a list over the files in the "photo" directory, they don't work when I press their links.. Have a look at [photo.example.dk...]
The code I used is this:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^photo\.example\.dk [NC]
RewriteRule ^/?$ /photo/$1 [L]
Why does it show the index right, but not open the files?
[edited by: jdMorgan at 10:36 am (utc) on Dec. 29, 2003]
[edit reason] No specific URLs please [/edit]
Welcome to WebmasterWorld [webmasterworld.com]! (Please read)
It looks like your RewriteRule will only redirect if the requested URI (file) is either "/" or blank. Also, you have back-referenced local variable $1, but it is not defined. Back-references are defined by sub-patterns enclosed in parentheses. Try this:
RewriteRule (.*) /photo/$1 [L]
RewriteEngine on
RewriteCond %{HTTP_HOST} ^photo\.example\.dk [NC]
RewriteCond %{REQUEST_URI} !^/photo
RewriteRule (.*) /photo/$1 [L]