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
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
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
