Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

How to setup Vanilla on a sub-domain?

Okay, so here's my current setup. My main domain is site.host.com. I installed Vanilla in a "community" folder on the root of the site. I made a sub-domain (community.site.host.com) that points to the community folder. Now here's my problem, when I go to view a thread or something, it shows this as the URL:

http://community.site.host.com/home/crafted3/public_html/community/discussion/1/bam-you-ve-got-a-sweet-forum

(crafted3 is the username of my database or FTP account I believe) It also does this when directly viewing site.host.com/community

I'm sorry if this is hard to understand, I'm not quite sure why the URL is showing up this way. I just need to remove the crafted3/public_html/ part. I don't think it's anything to do with my host, as my previous MyBB install worked just fine.

Any ideas? Thanks!

«1

Comments

  • Try to uncomment "RewriteBase /" in your .htaccess file

  • Master99Master99 New
    edited December 2014

    @R_J said:
    Try to uncomment "RewriteBase /" in your .htaccess file

    There isn't a "RewriteBase /" line, should I add it?

    Edit: I added that line in, no effect :(

  • To install a forum in a subdirectory is different from a subdomain.

    To do it in a subdirectory which is the most common way:

    Create a folder called community in the root of your website so it is like www.yoursite.com/community in the file tree that is where all the files will be.

    If it is community.site.host.com , then that would be a root install. and the url should be

    community.site.host.com/discussion/1/bam-you-ve-got-a-sweet-forum

    look in the htaccess file and post what it looks like here. Also a screen shot of how your files are stored in your server host can help.

  • I hate super strange, uncommon issues like these...

  • @vrijvlinder said:
    To install a forum in a subdirectory is different from a subdomain.

    To do it in a subdirectory which is the most common way:

    Create a folder called community in the root of your website so it is like www.yoursite.com/community in the file tree that is where all the files will be.

    If it is community.site.host.com , then that would be a root install. and the url should be

    community.site.host.com/discussion/1/bam-you-ve-got-a-sweet-forum

    look in the htaccess file and post what it looks like here. Also a screen shot of how your files are stored in your server host can help.

    I added the "RewriteBase /" line manually.

    FTP:

  • I am not sure what you did there... but the htaccess file for vanilla looks like this

    # Modified
    # If you modify this file then change the above line to: # Modified
    <IfModule mod_rewrite.c>
       RewriteEngine On
       # Certain hosts may require the following line.
       # If vanilla is in a subfolder then you need to specify it after the /. 
       # (ex. You put Vanilla in /forum so change the next line to: RewriteBase /forum)
       RewriteBase /
       RewriteCond %{REQUEST_FILENAME} !-d
       RewriteCond %{REQUEST_FILENAME} !-f
       RewriteRule ^(.*)$ index.php\?p=$1 [QSA,L]
    </IfModule>
    

    If you have any other htaccess files in the folder you installed vanilla there will be problems.

    I suggest you use and subdirectory instead of a subdomain...

  • @vrijvlinder said:
    I am not sure what you did there... but the htaccess file for vanilla looks like this

    # Modified
    # If you modify this file then change the above line to: # Modified
    <IfModule mod_rewrite.c>
       RewriteEngine On
       # Certain hosts may require the following line.
       # If vanilla is in a subfolder then you need to specify it after the /. 
       # (ex. You put Vanilla in /forum so change the next line to: RewriteBase /forum)
       RewriteBase /
       RewriteCond %{REQUEST_FILENAME} !-d
       RewriteCond %{REQUEST_FILENAME} !-f
       RewriteRule ^(.*)$ index.php\?p=$1 [QSA,L]
    </IfModule>
    

    If you have any other htaccess files in the folder you installed vanilla there will be problems.

    I suggest you use and subdirectory instead of a subdomain...

    I copied the code into my .htaccess with still no effect.

    I have Vanilla installed in a subdirectory. I simply have a subdomain that points to that directory. So when I visit community.site.host.com it's still accessing the community directory.

  • Ok , well it looks like something is not right.

    Let me give you an example of what I did:

    I have vrijvlinder.com the root of my site, then I added a folder under that domain called forum so vanilla is installed in subdirectory vrijvlinder.com/forum and no other file other than that for the forum is inside that folder.

    If I installed it in forum.vrijvlinder.com/ that means it is a sub domain and is also a root so again only vanilla forum files would exist in that folder.

    BTW Try using Filezilla for ftp I think it is the most stable.

  • @vrijvlinder said:
    Ok , well it looks like something is not right.

    Let me give you an example of what I did:

    I have vrijvlinder.com the root of my site, then I added a folder under that domain called forum so vanilla is installed in subdirectory vrijvlinder.com/forum and no other file other than that for the forum is inside that folder.

    If I installed it in forum.vrijvlinder.com/ that means it is a sub domain and is also a root so again only vanilla forum files would exist in that folder.

    BTW Try using Filezilla for ftp I think it is the most stable.

    I think the way you're setting up subdomains is different from the way I'm doing it. I just go into my cPanel > subdomains, enter a subdomain name and choose the folder for it. I installed MyBB exactly the same way awhile back and had no issues like this

  • edited December 2014

    Ok, so what is the name of the folder for vanilla ? community.mysite.com/ ?

    If you are getting the public html in the link , that you need to sort out with your host and the htaccess for your main site.

    Or you can try adding this to htaccess of your main site to remove the public part.

    <IfModule mod_rewrite.c>
        RewriteEngine On
    
        RewriteRule ^(.*)$ public/$1 [L]
    </IfModule>
    
  • @vrijvlinder said:
    Ok, so what is the name of the folder for vanilla ? community.mysite.com/ ?

    If you are getting the public html in the link , that you need to sort out with your host and the htaccess for your main site.

    The folder itself is in site.host.com/community. I still get the issues from that link as well.

  • @Master99 said:
    The folder itself is in site.host.com/community.

    Then your vanilla htaccess file should be

    # Modified
    # If you modify this file then change the above line to: # Modified
    <IfModule mod_rewrite.c>
       RewriteEngine On
       # Certain hosts may require the following line.
       # If vanilla is in a subfolder then you need to specify it after the /. 
       # (ex. You put Vanilla in /forum so change the next line to: RewriteBase /forum)
       RewriteBase /community
       RewriteCond %{REQUEST_FILENAME} !-d
       RewriteCond %{REQUEST_FILENAME} !-f
       RewriteRule ^(.*)$ index.php\?p=$1 [QSA,L]
    </IfModule>
    

    But if your main site has the wrong settings in the htaccess file this may not do anything noticeable

  • Still, no effect :/ I guess I'll have to contact my host.
    What should my main site's htaccess file look like?

  • edited December 2014

    @Master99 said:
    What should my main site's htaccess file look like?

    That I can't know. You need to ask your host to set it up for you or tell you how it should be. I can only tell you what that vanilla htaccess file need to look like.

  • Okay, thank you very much! I appreciate the help and your patience with me. I hope I can get this fixed, I really want to use Vanilla for my site...

  • No problem glad to help when I can. Please Let us know how you sorted it out when you do.

  • Sorry, I wrote that at 4AM...

    Try that line in your .htaccess: RewriteBase /home/crafted3/public_html/community

    Btw.: it's in the FAQ ;)

  • @R_J said:
    Sorry, I wrote that at 4AM...

    Try that line in your .htaccess: RewriteBase /home/crafted3/public_html/community

    Btw.: it's in the FAQ ;)

    Still nothing.

  • I deleted my public_html .htaccess file, thinking a new fresh one would be generated. I was then able to find the original Vanilla .htaccess file from my downloaded .zip file. I uploaded it and all I changed was uncommenting "# RewriteBase /" and changed it to "RewriteBase /community".

    Now when I view site.host.com/community everything works perfectly. However, when I try to view it via the community.site.host.com subdomain, I get a "500 internal server error"

    I'm thinking this is due to the fact that I deleted the public_html .htaccess file. I'm not sure though, because I believe that file is empty by default. I might just have to go back to MyBB... :(

Sign In or Register to comment.