• 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)

Brent W

Well-known member
#5
It uses htaccess rewrites to achieve that :) You can do the same.
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.
 

Khaleal

Active member
#6
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.
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.
 

sonnb

Well-known member
#8
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.
Would it work if you are using Nginx, Litespeed,.. ? Because these servers do not use .htaccess.