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

URL www -> root

Hello!

I've run into a bit of a problem. I'm usually able to figure these things out, but I'm stumped! My website is automatically redirecting from www.armyoflove.net to armyoflove.net, which I don't want it to do. In fact, I'd like it to do the opposite! I've been testing various things over the past week (DNS, virtual hosts on my server, etc.), but nothing worked, so I'm thinking that it might be a file from Vanilla that's causing the redirect. However, after browsing through all the files that seemed to have something to do with configuration and analyzing the .htaccess file (which I'm not too familiar with), I haven't been able to find anything that might be causing the problem.

Maybe I'm wrong and I've overlooked something in my server settings, but I wanted to try asking here in case someone has a solution because I've run out of light bulbs to guide me. xD

Comments

  • Options

    Welcome to the community!

    It's probably not Vanilla that's doing this. It sometimes has to do with the Apache config and sometimes web browsers hide the www from the URL. You can try adding the following lines in the .htaccess file right after Vanilla's RewriteRule.

    RewriteCond %{HTTP_HOST} !^www\.
    RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
    

    Let me know if this works for you.

    Add Pages to Vanilla with the Basic Pages app

  • Options

    That works! Thank you very much! :3

    I'm using nginx instead of Apache for my web server, which creates problems for me sometimes. Not because its setup is difficult (this was the first time I've run into anything that wasn't a simple fix in a configuration file), but because it's not as widely supported as Apache.

    Anyways, thank you again! :D

  • Options

    You're welcome! I thought you were using Apache since you mentioned the .htaccess file. I also use Nginx, which is awesome too. :)

    Add Pages to Vanilla with the Basic Pages app

Sign In or Register to comment.