We build. You grow.

Get best community software here

Start a social network, a fan-site, an education project with oxwall - free opensource community software

how make sub-domain work as main domain? | Forum

Topic location: Forum home » Support » General Questions
WOO
WOO May 27 '16
I add a sub-domain(like photo.mydomain.com) to my website.


Now, if I visit by http://photo.mydomain.com, it will jump to http://www.mydomain.com.


How make photo.mydomain.com work?


Who can tell? Thanks!


dave Leader
dave May 27 '16
Its because oxwall sees your sub domain as just another folder in the directory.  So you need to tell oxwall that you need to run that folder via the browser. 


see here  https://developers.oxwall.com/forum/topic/47116



WOO
WOO May 28 '16
Thanks!


I do what you said. But it does not work. It jump to http://www.aimphotos.com again when I visit via http://photo.aimphotos.com.


The content of .htaccess is:


Options +FollowSymLinks
RewriteEngine On

AddEncoding gzip .gz
AddEncoding gzip .gzip
<FilesMatch "\.(js.gz|js.gzip)$">
  ForceType text/javascript
</FilesMatch>
<FilesMatch "\.(css.gz|css.gzip)$">
  ForceType text/css
</FilesMatch>


#added to access custom files - sub domains or special folders
#--------
#subdomains and add on domains
#RewriteCond %{HTTP_HOST} !photo.aimphotos.com$
#

# folders

#RewriteCond %{REQUEST_URI} !/photo/viewlist/latest/

#

# files

#RewriteCond %{REQUEST_URI} !/index.php



RewriteCond %{REQUEST_URI} !^/index\.php
RewriteCond %{REQUEST_URI} !/ow_updates/index\.php
RewriteCond %{REQUEST_URI} !/ow_updates/
RewriteCond %{REQUEST_URI} !/ow_cron/run\.php
RewriteCond %{REQUEST_URI} !/e500\.php
RewriteCond %{REQUEST_URI} !/captcha\.php
#RewriteCond %{REQUEST_URI} (/|\.php|\.html|\.htm|\.xml|\.feed|robots\.txt|\.raw|/[^.]*)$  [NC]
RewriteCond %{REQUEST_FILENAME} (/|\.php|\.html|\.htm|\.xml|\.feed|robots\.txt|\.raw|/[^.]*)$  [NC]
RewriteRule (.*) index.php

Is there something wrong?

The Forum post is edited by WOO May 28 '16
dave Leader
dave May 28 '16
yes you have your two lines commented out..


#this is a comment

this is live code


RewriteCond %{HTTP_HOST} !photo.aimphotos.com$
#

# folders

RewriteCond %{REQUEST_URI} !/photo/viewlist/latest/


make it look like that 

ross Team
ross May 30 '16
Woo try the solution from here: https://my.bluehost.com/cgi/help/347
WOO
WOO May 31 '16
Thanks! Dave and Ross.


I have removed "#", but still jump back to www.domain.com


And I will take a look of the solution from bluehost.


Is there any conflict with origin lines in .htaccess?


Now, it is as below:


-----------------------------------------------


Options +FollowSymLinks

RewriteEngine On



AddEncoding gzip .gz

AddEncoding gzip .gzip

<FilesMatch "\.(js.gz|js.gzip)$">

  ForceType text/javascript

</FilesMatch>


<FilesMatch "\.(css.gz|css.gzip)$">

ForceType text/css

</FilesMatch>



#added to access custom files - sub domains or special folders


#--------


#subdomains and add on domains

RewriteCond %{HTTP_HOST} !photo.aimphotos.com$

#

# folders

RewriteCond %{REQUEST_URI} !/photo/viewlist/latest/

#

# files

RewriteCond %{REQUEST_URI} !/index.php

RewriteCond %{REQUEST_URI} !^/index\.php

RewriteCond %{REQUEST_URI} !/ow_updates/index\.php

RewriteCond %{REQUEST_URI} !/ow_updates/

RewriteCond %{REQUEST_URI} !/ow_cron/run\.php

RewriteCond %{REQUEST_URI} !/e500\.php

RewriteCond %{REQUEST_URI} !/captcha\.php

#RewriteCond %{REQUEST_URI} (/|\.php|\.html|\.htm|\.xml|\.feed|robots\.txt|\.raw|/[^.]*)$  [NC]

RewriteCond %{REQUEST_FILENAME} (/|\.php|\.html|\.htm|\.xml|\.feed|robots\.txt|\.raw|/[^.]*)$  [NC]

RewriteRule (.*) index.php


-----------------------------------------------


The Forum post is edited by WOO May 31 '16