Forum Moderators: phranque

Message Too Old, No Replies

.htaccess subdomain spoofing?

         

misterm2008

9:48 am on Jun 26, 2008 (gmt 0)

10+ Year Member



Hi

I read this post from 2005: [webmasterworld.com...]

RewriteEngine on
#
# check that the host header as at least one character;
# that way we know it's been sent by the browser
RewriteCond %{HTTP_HOST} .
#
# Check the host header; if it's not 'www.domain.com',
# (or 'domain.com'), we don't care about it for this
# Rule
RewriteCond %{HTTP_HOST} ^(www.)?domain.com
#
# Ok, we can Rewrite this
RewriteRule ^/sub/ - [F,L]

I am trying to do a similar thing, but instead of creating a subdomain that points to a directory, I want to point to a file.

So for example

I want Leeds.mysite.co.uk

to point to mysite.co.uk/leeds.html

Any ideas would be much appreciated.

Mr M

jdMorgan

6:12 pm on Jun 26, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Please post your best-effort code as a basis for discussion.

The tutorials in our Apache Forum Library may come in handy, and links to documentation are available in our Forum Charter.

Thanks,
Jim