SMF Support > Server Performance and Configuration

Non WWW to WWW

<< < (2/7) > >>

MrPhil:
You're missing a /, and don't need NC on the rewrite rule, as . matches any case.

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

--- End code ---

Luka Paunović:

--- Quote from: Arantor on June 09, 2012, 02:13:21 PM ---
--- Code: ---RewriteEngine on
rewritecond %{http_host} ^internetfazoni.com [nc]
rewriterule ^(.*)$ http://www.internetfazoni.com$1 [r=301,nc]

--- End code ---

You don't strictly need that last RewriteCond in there.

--- End quote ---

This rule makes non www urls do not work at all...


--- Quote from: MrPhil on June 11, 2012, 03:04:09 PM ---You're missing a /, and don't need NC on the rewrite rule, as . matches any case.

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

--- End code ---

--- End quote ---

It working,all non www urls are redirected to www (including topics urls) but he do not redirect to right url.
On example...
Topic url is internetfazoni.com/it-vesti/sopa-je-gotova/
and he redirects to www, but to wrong url http://www.internetfazoni.com/index.php?pretty%3bboard=it-vesti%3btopic=sopa-je-gotova.0
This url redirects to index page...
PROBLEM.
HELP.

MrPhil:
Put the three lines to redirect to www before the SEO/SEF lines. It looks like you're converting from SEO to non-SEO form, and then adding the www., which means the non-SEO form (dynamic) URL will be seen by the user. Hopefully that will fix the topic name appearing instead of the topic number.

Luka Paunović:

--- Quote from: MrPhil on June 11, 2012, 08:17:40 PM ---Put the three lines to redirect to www before the SEO/SEF lines. It looks like you're converting from SEO to non-SEO form, and then adding the www., which means the non-SEO form (dynamic) URL will be seen by the user. Hopefully that will fix the topic name appearing instead of the topic number.

--- End quote ---
]

Sorry I do not get it...
My mother language is not english.
By the way, I am using Pretty Url

MrPhil:
Add the www-change code before any lines for SEO. The easiest thing is to put them at the very beginning of the .htaccess file.

Navigation

[0] Message Index

[#] Next page

[*] Previous page

Go to full version