News:

SMF 2.0.19 has been released! Please update. Read more.

Main Menu

Add www in the forum url

Started by Narheru, August 27, 2014, 05:46:42 AM

Previous topic - Next topic

Narheru

Hello!
I've tried to search a question like this, but maybe I'm not so good to search and so I'm sorry inthe case there's just a topic about.

If I surf on my forum, the url is like mysite.com/forum and not like http://www.mysite.com/forum. I'd like to know how can I add "http://www." I've tried to watch in server settings, but I could find nothing.

I can do it with repair_settings?

Thanks
(my forum is http://www.rpgnews.it/forum)

Justyne

Have a look what it says here:

Admin > Configuration > Database and Paths

and check the field Forum URL

The www should be in there if you want it displayed.
Ever tried. Ever failed. No matter. Try Again. Fail again. Fail better.

Narheru

Ok, it seems it's solved.
I didn't notice that option.

Thanks :D

Narheru


mashby

Do they both work? With and without the www? Mind sharing your site's forum URL?
Always be a little kinder than necessary.
- James M. Barrie

Kindred

If you want to use the www, then you need to set your forum urls (all of them) to use the www.
You probably also want to add .htaccess lines to bounce everyone to the www version,
Слова
Украина

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

a10

Quoteadd .htaccess lines to bounce everyone to the www version
This one has been working perfect here:


RewriteEngine On
RewriteCond %{HTTP_HOST} ^yoursite.com
RewriteRule (.*) http://www.yoursite.com/$1 [R=301,L]
2.0.19, php 7.4.26, MariaDB 10.3.32. Mods: Contact Page, Like Posts, Responsive Curve, Search Focus Dropdown, Add Join Date to Post.

Narheru

Quote from: mashby on September 01, 2014, 04:18:13 PM
Do they both work? With and without the www? Mind sharing your site's forum URL?

Yes, they both work.
It's in the first post( http://www.rpgnews.it/forum)

Quote from: a10 on September 01, 2014, 09:26:11 PM
Quoteadd .htaccess lines to bounce everyone to the www version
This one has been working perfect here:


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


I have to add those lines in the .htaccess file?

Edit: I've tried to add those lines, but the forum doesn't load CSS Style or topic.
My .htaccess file is:

RewriteEngine on
RewriteBase /forum
RewriteCond %{HTTP_HOST} ^rpgnews.it
RewriteRule (.*) http://www.rpgnews.it/$1 [R=301,L]
# Rules for: boards
RewriteRule ^([-_!~*'()$a-zA-Z0-9]+)/?$ ./index.php?pretty;board=$1.0 [L,QSA]
RewriteRule ^([-_!~*'()$a-zA-Z0-9]+)/([0-9]*)/?$ ./index.php?pretty;board=$1.$2 [L,QSA]

# Rules for: topics
RewriteRule ^([-_!~*'()$a-zA-Z0-9]+)/([-_!~*'()$a-zA-Z0-9]+)/?$ ./index.php?pretty;board=$1;topic=$2.0 [L,QSA]
RewriteRule ^([-_!~*'()$a-zA-Z0-9]+)/([-_!~*'()$a-zA-Z0-9]+)/([0-9]*|msg[0-9]*|new)/?$ ./index.php?pretty;board=$1;topic=$2.$3 [L,QSA]

# PRETTYURLS MOD ENDS

Chalky

That's Pretty URLs messing that up and probably causing other problems too.  Disable Pretty URLs.

Narheru

Quote from: Chalky on September 02, 2014, 05:18:38 AM
That's Pretty URLs messing that up and probably causing other problems too.  Disable Pretty URLs.

Now It seems to work.
So I can't use "Pretty Urls" and add "www" for the url? Or is It a problem of settings?

Thanks :D

Chalky

Yay  :)  The thing is, Pretty URLs rewrites the URLs and the extra lines you're adding to your .htaccess are to -um- rewrite the URLs.  It's the ultimate conflict.  There may be something in the mod settings that lets you synchronise their efforts - I don't know, I've never used it - but that would be a question for the mod support topic, and Pretty URLs is pretty notorious for causing all manner of problems anyway.

Advertisement: