FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


Resolved: Fake' sub domains?





richard270384
Does anybody know if/how I can do this?

I want to have http://sub-domain.domain.com redirect behind the scenes to http://domain.com/index.php?page=sub-domain

But I still want it to say http://sub-domain.domain.com in the browser window?

Cheers,
Richard

Edit:

Sorry, just found a solution on google. FYI in case anybody finds this thread down the track, the solution is this:

1. Add "sub-domain.domain.com" as an add-on domain. In my case I set the home folder for this domain to the same folder as "domain.com".
2. In the home folder, create a file ".htaccess" (unless one already exists)
3. Add this to the .htaccess file
Quote:

Options +FollowSymlinks

RewriteEngine on

RewriteCond %{HTTP_HOST} ^(www\.)?([^.]+)\.domain\.com
RewriteRule ^$ /index.php?page=%2 [L]


You need to change "domain\.com" to "your-domain\.your-tld"
4. In your index.php, you can now access the subdomain using the php code $_GET['page'].

Cheers,
Richard
Related topics
Sub domains and add-on domains
domains
Sub-Domains
Sub domain
How come we can change our sub-domains thru DA on S2 now?
Domains
"Named" Sub-Domains
what are valid sub domains when requesting hosting
Custom 404 not found file for sub domains....
pls guide me about sub domains names ?
Two sub-domains?
subdomain
Pointing a domain I bought to one of my Sub-domains.
Sub domains not working.
Reply to topic    Frihost Forum Index -> Webmaster and Internet -> Domain Names

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.