Subdomains
Posted: 13. January 2013 11:14
Hi guys.
I've set up xampp on a Windows dedicated server (and connected with a domain). I'm currently creating a blog portal, where each user can set up their own blog. And then get your own blog address. Each user must therefore have the ability to use "username.domain.com". As of now i have the working .htaccess to do this, but i need help with the rest. (I'm new to Apache and xampp, so a detailed reply would be helpful.)
I hope one of you can help me out!
Thanks.
I've set up xampp on a Windows dedicated server (and connected with a domain). I'm currently creating a blog portal, where each user can set up their own blog. And then get your own blog address. Each user must therefore have the ability to use "username.domain.com". As of now i have the working .htaccess to do this, but i need help with the rest. (I'm new to Apache and xampp, so a detailed reply would be helpful.)
I hope one of you can help me out!
Thanks.
- Code: Select all
RewriteEngine On
Options +Followsymlinks
RewriteBase /
RewriteCond %{HTTP_HOST} .
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteCond %{REQUEST_FILENAME} !^.*/images/.*$
RewriteCond %{REQUEST_FILENAME} !^.*/uploads/.*$
RewriteCond %{HTTP_HOST}<>%{REQUEST_URI} ^([^.]+)\.DOMENE\.net(:80)?<>/([^/]*) [NC]
RewriteCond %1<>%3 !^(.*)<>\1$ [NC]
RewriteRule ^(.*)$ - [E=BLOGUSER:%1]
RewriteCond %{ENV:BLOGUSER} ^(.+)$
RewriteRule ^$ /index.php?w=%1 [L]
RewriteCond %{ENV:BLOGUSER} ^(.+)$
RewriteRule ^page([0-9]+)/([^/]+)?$ /index.php?w=%1&page=$1$2 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^profiles/([^/]+)/([^/]+)?$ /profile.php?u=$1$2 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^profiles/?$ /profile.php [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^albums/([^/]+)/([^/]+)?$ /album.php?u=$1$2 [L]
RewriteCond %{ENV:BLOGUSER} ^(.+)$
RewriteRule ^archive/(.*)/(.*)/([^/]+)?$ /archive.php?w=%1&y=$1&m=$2$3 [L]
RewriteCond %{ENV:BLOGUSER} ^(.+)$
RewriteRule ^archive\.php/(.*)/(.*)/([^/]+)?$ /archive.php?w=%1&y=$1&m=$2$3 [L]
RewriteCond %{ENV:BLOGUSER} ^(.+)$
RewriteRule ^archive/(.*)/([^/]+)?$ /archive.php?w=%1&y=$1$2 [L]
RewriteCond %{ENV:BLOGUSER} ^(.+)$
RewriteRule ^archive\.php/(.*)/([^/]+)?$ /archive.php?w=%1&y=$1$2 [L]
RewriteCond %{ENV:BLOGUSER} ^(.+)$
RewriteRule ^archive/([^/]+)?$ /archive.php?w=%1$1 [L]
RewriteCond %{ENV:BLOGUSER} ^(.+)$
RewriteRule ^archive\.php/([^/]+)?$ /archive.php?w=%1$1 [L]
RewriteCond %{ENV:BLOGUSER} ^(.+)$
RewriteRule ^friends/([^/]+)?$ /friends.php?w=%1$1 [L]
RewriteCond %{ENV:BLOGUSER} ^(.+)$
RewriteRule ^friends\.php/([^/]+)?$ /friends.php?w=%1$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^/]+)/friends/page([0-9]+)/([^/]+)?$ /friends.php?w=$1&page=$2$3 [L]
RewriteCond %{ENV:BLOGUSER} ^(.+)$
RewriteRule ^([0-9]+)/([^/]+).html$ /entry.php?w=%1&e_id=$1 [L]
RewriteCond %{ENV:BLOGUSER} ^(.+)$
RewriteRule ^([0-9]+)/([^/]+)?$ /entry.php?w=%1&e_id=$1$2 [L]
RewriteCond %{ENV:BLOGUSER} ^(.+)$
RewriteRule ^&([^/]+)?$ /index.php?w=%1&$1 [L]
RewriteCond %{ENV:BLOGUSER} ^(.+)$
RewriteRule ^([^/]+)/([^/]+)?$ /index.php?w=%1&category=$1$2 [L]
RewriteCond %{ENV:BLOGUSER} ^(.+)$
RewriteRule ^([^/]+)/page([0-9]+)/([^/]+)?$ /index.php?w=%1&category=$1&page=$2$3 [L]