Non WWW to WWW

Started by SimpleGost, June 06, 2012, 04:22:02 PM

Previous topic - Next topic

SimpleGost

Hi...
I have this problem.
BIG PROBLEM.
It making me duplicated content.

I have this code in my htaccess


RewriteEngine on
RewriteCond %{HTTP_HOST} ^internetfazoni.com$
RewriteRule ^/?$ "http\:\/\/www\.internetfazoni\.com\/" [R=301,L]


http://internetfazoni.com/index.php (redirection to www works)
http://internetfazoni.com/it-vesti/ (redirection to www on boards work)
http://internetfazoni.com/it-vesti/vip-poklanja-samsung-smart-tv/ REDIRECTION TO WWW FROM TOPICS DO NOT WORK!
That is my problem.
Help me please :(
The problem is not in the pretty url mod, because problem is same and without it (when i turn it off)

SimpleGost


novill

Try this.


RewriteEngine on
rewritecond %{http_host} ^internetfazoni.com [nc]
rewriterule ^(.*)$ http://www.internetfazoni.com$1 [r=301,nc]
RewriteCond %{REQUEST_URI}  ^/index\.php$


SimpleGost

Quote from: novill on June 09, 2012, 09:56:59 AM
Try this.


RewriteEngine on
rewritecond %{http_host} ^internetfazoni.com [nc]
rewriterule ^(.*)$ http://www.internetfazoni.com$1 [r=301,nc]
RewriteCond %{REQUEST_URI}  ^/index\.php$


Then nothing work at all :P

Arantor

RewriteEngine on
rewritecond %{http_host} ^internetfazoni.com [nc]
rewriterule ^(.*)$ http://www.internetfazoni.com$1 [r=301,nc]


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

MrPhil

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

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

SimpleGost

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


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

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.

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


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.

SimpleGost

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

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.

SimpleGost

Quote from: MrPhil on June 12, 2012, 07:07:05 PM
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.

Sorry friend, i do not understand :(

Kill Em All

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


At the top of the .htaccess file.

.htaccess file should read as:

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

blah blah
blah blah


My Site: KEAGaming.com

Manual Installation of Mods
Prevent Spam and Forum Attacks
Please do not PM or email me for support unless offered, help should be publicly displayed to others.

Sap_Payment

Don't worry about WWW,
i hope in usa site took wwwdot sitename dot come
duplicate content for the code rel="cronical" href='"priory url"

SimpleGost

Quote from: Kill Em All on June 13, 2012, 01:15:42 AM
Put this:
RewriteEngine On
RewriteCond  %{HTTP_HOST}  ^internetfazoni\.com  [NC]
RewriteRule  ^(.*)$  http://www.internetfazoni.com/$1  [R=301,L]


At the top of the .htaccess file.

.htaccess file should read as:

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

blah blah
blah blah

He should just say "Put the rule in the first line of .htaccess"
lol

Kill Em All

lol, there are always language barriers that people have to overcome. It is sometimes hard to convey things in text too.

Let us know if it works. :)


My Site: KEAGaming.com

Manual Installation of Mods
Prevent Spam and Forum Attacks
Please do not PM or email me for support unless offered, help should be publicly displayed to others.

SimpleGost

IT DO NOT WORK!!!!!
OF COURSE IT DID NOT WORK!
And this problem CAN'T be FIXED because that SAME problem is on simplemachines.org
as you can see here

simplemachines.org/community/index.php?topic=478482.0

Try it :P

Kill Em All

I'm afraid I'm confused now. The link works just fine for me. If you are trying to say the link you posted isn't working.

If that is the case, it seems that it might be a problem on your end.

As a side note, it's not polite to type in all caps.


My Site: KEAGaming.com

Manual Installation of Mods
Prevent Spam and Forum Attacks
Please do not PM or email me for support unless offered, help should be publicly displayed to others.

SimpleGost

Quote from: Kill Em All on June 15, 2012, 04:06:37 PM
I'm afraid I'm confused now. The link works just fine for me. If you are trying to say the link you posted isn't working.

If that is the case, it seems that it might be a problem on your end.

As a side note, it's not polite to type in all caps.

I tried to disable pretty url. THE SAME!
But.. how is possible that simplemachines forum did not fixed that? :D
Look http://simplemachines.org/community/index.php?topic=478482.0
SAME PROBLEM.

Adrek

To redirect 'non-www' urls I'm using always this code in htaccess file:

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


never had any problems
Polskie wsparcie SMF na simplemachines.org

the simplest solution is most likely the right one

SimpleGost

Quote from: phantomm on June 16, 2012, 08:10:45 AM
To redirect 'non-www' urls I'm using always this code in htaccess file:

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


never had any problems

Give me the url of the site and I will find the problem right now now now now :P

Advertisement: