1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

301 Direct WWW To Non WWW (and vice versa)

Discussion in 'XenForo Suggestions' started by BamaStangGuy, Jul 29, 2013.

  1. BamaStangGuy

    BamaStangGuy Well-Known Member

    Wordpress has a great feature that takes your wordpress url and automatically redirects to that.

    So if I were to use http://www.mysite.com has my board url, http://mysite.com would automatically be 301 redirect to http://www.mysite.com.

    Works the other way as well.

    This will be a nice easy SEO enhancement for everyone and will not require any .htaccess edit to make it happen.
  2. JulianD

    JulianD Well-Known Member

    What server do you use? This can be achieved using rewrites.
  3. BamaStangGuy

    BamaStangGuy Well-Known Member

    I know how to do it via .htaccess.
  4. Khaleal

    Khaleal Active Member

    It uses htaccess rewrites to achieve that :) You can do the same.
  5. BamaStangGuy

    BamaStangGuy Well-Known Member

    I realize how to do it via .htaccess (for the second time now). This is more of a user friendly request for others (and to save me time from having to find the two lines I need for each site I buy / purchase / create).

    Its a small request but something that if worked out of the box would benefit everyone. I run into sites all the time that do not take advantage of this.
    FredC likes this.
  6. Khaleal

    Khaleal Active Member

    Wordpress has the "two lines" in it's database and it automates the process by injecting the code into the .htaccess file. It also requires a 666 permission on that file.
    BTW, Wordpress has that feature because no .htaccess files are attached with the script package and creating it is optionally. While xenForo contains it by default as I know so no need to inject the rules to the .htaccess files when the admin want to change how URLs look.
    BamaStangGuy likes this.
  7. TheComputerGuy

    TheComputerGuy Active Member

    Brent if you need help, just ping me on here!
  8. sonnb

    sonnb Well-Known Member

    Would it work if you are using Nginx, Litespeed,.. ? Because these servers do not use .htaccess.
  9. Khaleal

    Khaleal Active Member

    This may help you
  10. sonnb

    sonnb Well-Known Member

    So it is again, require extra configuration? Then why not manually do it?
  11. FredC

    FredC Well-Known Member

    Or in my case somehow manage to make it do all kinds of funky undesirable things. :p
    BamaStangGuy likes this.

Share This Page