Jump to content

[SOLVED] Subdomain URL's


The Little Guy

Recommended Posts

If you have a hosting package, your package either comes with x number of subdomains or not. If not, and you create them anyways, you would likely be violating your TOS with your hosting company. If you have access to .htaccess, .htaccess IS a document used by Apache, so it is an Apache issue...

 

PhREEEk

Link to comment
Share on other sites

OK, here is what I have now!

RewriteEngine On

Options -MultiViews

#RewriteCond %{REQUEST_URI}!^/sd_
#RewriteCond %{HTTP_HOST}!^www\.hostbox\.us [NC]
#RewriteCond %{HTTP_HOST} ^([^.]+)\.hostbox\.us
#RewriteRule (.*) /sd_%1/$1 [L] 
RewriteCond %{HTTP_HOST} !^www\.hostbox\.us
RewriteCond %{HTTP_HOST} ([^.]+)\.hostbox\.us [NC]
Options +FollowSymlinks
RewriteRule ^http://(.*)\.hostbox\.us$ http://hostbox.us/viewFile.php?user=$1 [L,R]

 

basically it works, the problem is that it only shows the root folder tree of my hostbox.us folder. It isn't loading viewFile.php in the background anyone know why?

Link to comment
Share on other sites

Looks like I got it!!

 

Options +FollowSymLinks

RewriteEngine On

# Fix missing trailing slashes.
RewriteCond %{HTTP_HOST} !^(www\.)?hostbox\.us$ [NC]
RewriteCond %{HTTP_HOST} ^(www\.)?([^\.]+)\.hostbox\.us$ [NC]
RewriteCond %{DOCUMENT_ROOT}/%2%{REQUEST_URI}/ -d
RewriteRule [^/]$ %{REQUEST_URI}/ [R=301,L]

# Rewrite sub domains.
RewriteCond %{ENV:REDIRECT_STATUS} ^$
RewriteCond %{HTTP_HOST} !^(www\.)?hostbox\.us$ [NC]
RewriteCond %{HTTP_HOST} ^(www\.)?([^\.]+)\.hostbox\.us$ [NC]
RewriteRule ^(.*)$ subdomains/%2/$1 [QSA,L]

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.