Advertisement:

Author Topic: Non WWW to WWW  (Read 8595 times)

Offline Luka Paunović

  • Full Member
  • ***
  • Posts: 625
  • Gender: Male
  • :)
    • internetfazon on Facebook
    • @lukapaunovic on Twitter
    • Internet Fazoni
Non WWW to WWW
« on: June 06, 2012, 04:22:02 PM »
Hi...
I have this problem.
BIG PROBLEM.
It making me duplicated content.

I have this code in my htaccess

Code: [Select]
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)


www.pegazhosting.com
█ Web Hosting | Reseller Hosting | Registracija Domena

Offline Luka Paunović

  • Full Member
  • ***
  • Posts: 625
  • Gender: Male
  • :)
    • internetfazon on Facebook
    • @lukapaunovic on Twitter
    • Internet Fazoni
Re: Non WWW to WWW
« Reply #1 on: June 09, 2012, 09:47:38 AM »
No one knows?!


www.pegazhosting.com
█ Web Hosting | Reseller Hosting | Registracija Domena

Offline novill

  • Jr. Member
  • **
  • Posts: 173
  • Gender: Male
    • Hungarian electrician forum
Re: Non WWW to WWW
« Reply #2 on: June 09, 2012, 09:56:59 AM »
Try this.


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


Offline Luka Paunović

  • Full Member
  • ***
  • Posts: 625
  • Gender: Male
  • :)
    • internetfazon on Facebook
    • @lukapaunovic on Twitter
    • Internet Fazoni
Re: Non WWW to WWW
« Reply #3 on: June 09, 2012, 02:09:40 PM »
Try this.


Code: [Select]
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


www.pegazhosting.com
█ Web Hosting | Reseller Hosting | Registracija Domena

Offline Arantor

  • SMF Legend
  • *
  • Posts: 51,035
    • wedgebook on Facebook
Re: Non WWW to WWW
« Reply #4 on: June 09, 2012, 02:13:21 PM »
Code: [Select]
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.

Offline MrPhil

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 6,659
Re: Non WWW to WWW
« Reply #5 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: [Select]
RewriteEngine On
RewriteCond  %{HTTP_HOST}  ^internetfazoni\.com  [NC]
RewriteRule  ^(.*)$  http://www.internetfazoni.com/$1  [R=301,L]
Please do not PM me with support questions, unless I ask you to. Unsolicited PMs for support will be ignored. It's best to have questions and answers in public, so others can research a problem and learn about it without having to ask the question yet again. Thank you!
FAQs | SMF 1.1 fixes | Project ideas
-= From the ashes shall rise a sooty tern =-

Offline Luka Paunović

  • Full Member
  • ***
  • Posts: 625
  • Gender: Male
  • :)
    • internetfazon on Facebook
    • @lukapaunovic on Twitter
    • Internet Fazoni
Re: Non WWW to WWW
« Reply #6 on: June 11, 2012, 06:33:00 PM »
Code: [Select]
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...

You're missing a /, and don't need NC on the rewrite rule, as . matches any case.
Code: [Select]
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.


www.pegazhosting.com
█ Web Hosting | Reseller Hosting | Registracija Domena

Offline MrPhil

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 6,659
Re: Non WWW to WWW
« Reply #7 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.
Please do not PM me with support questions, unless I ask you to. Unsolicited PMs for support will be ignored. It's best to have questions and answers in public, so others can research a problem and learn about it without having to ask the question yet again. Thank you!
FAQs | SMF 1.1 fixes | Project ideas
-= From the ashes shall rise a sooty tern =-

Offline Luka Paunović

  • Full Member
  • ***
  • Posts: 625
  • Gender: Male
  • :)
    • internetfazon on Facebook
    • @lukapaunovic on Twitter
    • Internet Fazoni
Re: Non WWW to WWW
« Reply #8 on: June 12, 2012, 06:49:23 AM »
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


www.pegazhosting.com
█ Web Hosting | Reseller Hosting | Registracija Domena

Offline MrPhil

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 6,659
Re: Non WWW to WWW
« Reply #9 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.
Please do not PM me with support questions, unless I ask you to. Unsolicited PMs for support will be ignored. It's best to have questions and answers in public, so others can research a problem and learn about it without having to ask the question yet again. Thank you!
FAQs | SMF 1.1 fixes | Project ideas
-= From the ashes shall rise a sooty tern =-

Offline Luka Paunović

  • Full Member
  • ***
  • Posts: 625
  • Gender: Male
  • :)
    • internetfazon on Facebook
    • @lukapaunovic on Twitter
    • Internet Fazoni
Re: Non WWW to WWW
« Reply #10 on: June 12, 2012, 09:01:32 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 :(


www.pegazhosting.com
█ Web Hosting | Reseller Hosting | Registracija Domena

Offline Kill Em All

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 8,074
  • Gender: Male
  • Something has to go wrong. Just has to.
    • KEAGaming
Re: Non WWW to WWW
« Reply #11 on: June 13, 2012, 01:15:42 AM »
Put this:
Code: [Select]
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.

Offline Sap_Payment

  • Newbie
  • *
  • Posts: 3
Re: Non WWW to WWW
« Reply #12 on: June 13, 2012, 06:16:12 AM »
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"

Offline Luka Paunović

  • Full Member
  • ***
  • Posts: 625
  • Gender: Male
  • :)
    • internetfazon on Facebook
    • @lukapaunovic on Twitter
    • Internet Fazoni
Re: Non WWW to WWW
« Reply #13 on: June 13, 2012, 10:34:32 AM »
Put this:
Code: [Select]
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


www.pegazhosting.com
█ Web Hosting | Reseller Hosting | Registracija Domena

Offline Kill Em All

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 8,074
  • Gender: Male
  • Something has to go wrong. Just has to.
    • KEAGaming
Re: Non WWW to WWW
« Reply #14 on: June 14, 2012, 03:31:25 PM »
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.

Offline Luka Paunović

  • Full Member
  • ***
  • Posts: 625
  • Gender: Male
  • :)
    • internetfazon on Facebook
    • @lukapaunovic on Twitter
    • Internet Fazoni
Re: Non WWW to WWW
« Reply #15 on: June 14, 2012, 04:33:41 PM »
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


www.pegazhosting.com
█ Web Hosting | Reseller Hosting | Registracija Domena

Offline Kill Em All

  • SMF Friend
  • SMF Hero
  • *
  • Posts: 8,074
  • Gender: Male
  • Something has to go wrong. Just has to.
    • KEAGaming
Re: Non WWW to WWW
« Reply #16 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.
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.

Offline Luka Paunović

  • Full Member
  • ***
  • Posts: 625
  • Gender: Male
  • :)
    • internetfazon on Facebook
    • @lukapaunovic on Twitter
    • Internet Fazoni
Re: Non WWW to WWW
« Reply #17 on: June 15, 2012, 07:07:24 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.


www.pegazhosting.com
█ Web Hosting | Reseller Hosting | Registracija Domena

Offline phantomm

  • Sr. Member
  • ****
  • Posts: 883
  • Gender: Male
    • pages/smfpl/171860759503032 on Facebook
Re: Non WWW to WWW
« Reply #18 on: June 16, 2012, 08:10:45 AM »
To redirect 'non-www' urls I'm using always this code in htaccess file:
Code: [Select]
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

My mods

Offline Luka Paunović

  • Full Member
  • ***
  • Posts: 625
  • Gender: Male
  • :)
    • internetfazon on Facebook
    • @lukapaunovic on Twitter
    • Internet Fazoni
Re: Non WWW to WWW
« Reply #19 on: June 16, 2012, 03:22:04 PM »
To redirect 'non-www' urls I'm using always this code in htaccess file:
Code: [Select]
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


www.pegazhosting.com
█ Web Hosting | Reseller Hosting | Registracija Domena