Sponsor:

Server and Web Integrator
Link:
Kloxo-MR logo
6.5.0 or 7.0.0
Click for "How to install"
Donation/Sponsorship:
Kloxo-MR is open-source.
Donate and or Sponsorship always welcome.
Click to:
Click Here
Please login or register. 2024-04-28, 05:24:12

Author Topic: Redirect to www does not work  (Read 6923 times)

0 Members and 1 Guest are viewing this topic.

Offline Spacedust

  • Super Grand Master
  • ****
  • Posts: 4,050
  • Karma: +1/-0
    • View Profile
Redirect to www does not work
« on: 2013-05-11, 01:56:48 »
It goes from online.pl to:

Code: [Select]
http://www.online.pl/online.pl.0fake/index.php
and displays:

Code: [Select]
File not found.
« Last Edit: 1970-01-01, 01:00:00 by Guest »

Offline Spacedust

  • Super Grand Master
  • ****
  • Posts: 4,050
  • Karma: +1/-0
    • View Profile
Re: Redirect to www does not work
« Reply #1 on: 2013-05-11, 02:00:56 »
Code: [Select]
A. Kloxo-MR: 6.5.0.f-2013031812

B. OS: CentOS release 5.9 (Final) x86_64

C. Apps:
   1. MySQL: MariaDB-server-10.0.2-1
   2. PHP: php-5.4.15-1.el5.remi
   3. Httpd: httpd-2.2.24-1.el5
   4. Lighttpd: --uninstalled--
   5. Nginx: nginx-1.4.1-11.el5.art
   6. Qmail: qmail-toaster-1.03-1.3.22.mr.el5
   7. Dns: djbdns-1.05-5

D. Php-type (for Httpd/proxy): php-fpm_event

E. Memory:
                total       used       free     shared    buffers     cached
   Mem:         32171      31409        761          0       1646       5361
   -/+ buffers/cache:      24401       7769
   Swap:         2047        151       1896
« Last Edit: 1970-01-01, 01:00:00 by Guest »

Offline MRatWork

  • Administrator
  • The Elite
  • *****
  • Posts: 15,807
  • Karma: +119/-11
  • Gender: Male
    • View Profile
    • MRatWork Forum
Re: Redirect to www does not work
« Reply #2 on: 2013-05-11, 05:50:53 »
Is A or cname record already exist in dns setting?
« Last Edit: 1970-01-01, 01:00:00 by Guest »
..:: MRatWork (Mustafa Ramadhan Projects) ::..
-- Server/Web-integrator - Web Hosting (Kloxo-MR READY!) --

Offline Spacedust

  • Super Grand Master
  • ****
  • Posts: 4,050
  • Karma: +1/-0
    • View Profile
Re: Redirect to www does not work
« Reply #3 on: 2013-05-11, 06:36:51 »
Quote from: "MRatWork"
Is A or cname record already exist in dns setting?

Just normal A entry to __base__
« Last Edit: 1970-01-01, 01:00:00 by Guest »

Offline MRatWork

  • Administrator
  • The Elite
  • *****
  • Posts: 15,807
  • Karma: +119/-11
  • Gender: Male
    • View Profile
    • MRatWork Forum
Re: Redirect to www does not work
« Reply #4 on: 2013-05-11, 14:53:18 »
I mean 'A record' or 'CName record' for 'www'.
« Last Edit: 1970-01-01, 01:00:00 by Guest »
..:: MRatWork (Mustafa Ramadhan Projects) ::..
-- Server/Web-integrator - Web Hosting (Kloxo-MR READY!) --

Offline Spacedust

  • Super Grand Master
  • ****
  • Posts: 4,050
  • Karma: +1/-0
    • View Profile
Re: Redirect to www does not work
« Reply #5 on: 2013-05-11, 15:32:53 »
Quote from: "MRatWork"
I mean 'A record' or 'CName record' for 'www'.

Only A record
« Last Edit: 1970-01-01, 01:00:00 by Guest »

Offline MRatWork

  • Administrator
  • The Elite
  • *****
  • Posts: 15,807
  • Karma: +119/-11
  • Gender: Male
    • View Profile
    • MRatWork Forum
Re: Redirect to www does not work
« Reply #6 on: 2013-05-11, 16:33:02 »
I didn't found this issue in my dev301.potissima.com with redirect to www via 'Misc Config'.
« Last Edit: 1970-01-01, 01:00:00 by Guest »
..:: MRatWork (Mustafa Ramadhan Projects) ::..
-- Server/Web-integrator - Web Hosting (Kloxo-MR READY!) --

Offline Spacedust

  • Super Grand Master
  • ****
  • Posts: 4,050
  • Karma: +1/-0
    • View Profile
Re: Redirect to www does not work
« Reply #7 on: 2013-05-11, 16:43:01 »
On a new domain it does not work for me at all :/

Example:

test.subdomain.domain.pl is not forwared to www.test.subdomain.domain.pl
« Last Edit: 1970-01-01, 01:00:00 by Guest »

Offline Spacedust

  • Super Grand Master
  • ****
  • Posts: 4,050
  • Karma: +1/-0
    • View Profile
Re: Redirect to www does not work
« Reply #8 on: 2013-05-11, 16:52:33 »
It adds:

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

While there should be just - this one works well:

Code: [Select]
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
« Last Edit: 1970-01-01, 01:00:00 by Guest »

Offline MRatWork

  • Administrator
  • The Elite
  • *****
  • Posts: 15,807
  • Karma: +119/-11
  • Gender: Male
    • View Profile
    • MRatWork Forum
Re: Redirect to www does not work
« Reply #9 on: 2013-05-11, 17:32:27 »
Quote from: "Spacedust"
It adds:

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

While there should be just - this one works well:

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

Is nginx/apache think that .pl as perl extension rather than top/country-level domain?.
« Last Edit: 1970-01-01, 01:00:00 by Guest »
..:: MRatWork (Mustafa Ramadhan Projects) ::..
-- Server/Web-integrator - Web Hosting (Kloxo-MR READY!) --

Offline Spacedust

  • Super Grand Master
  • ****
  • Posts: 4,050
  • Karma: +1/-0
    • View Profile
Re: Redirect to www does not work
« Reply #10 on: 2013-05-11, 17:49:44 »
Quote from: "MRatWork"
Quote from: "Spacedust"
It adds:

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

While there should be just - this one works well:

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

Is nginx/apache think that .pl as perl extension rather than top/country-level domain?.

Maybe. So don't use it ! Just use my example and it will work.
« Last Edit: 1970-01-01, 01:00:00 by Guest »

Offline MRatWork

  • Administrator
  • The Elite
  • *****
  • Posts: 15,807
  • Karma: +119/-11
  • Gender: Male
    • View Profile
    • MRatWork Forum
Re: Redirect to www does not work
« Reply #11 on: 2013-05-11, 17:55:41 »
Your code:
Code: [Select]
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
may problem for wildcards domain (wordpress multisite need wildcards setting for dns).
« Last Edit: 1970-01-01, 01:00:00 by Guest »
..:: MRatWork (Mustafa Ramadhan Projects) ::..
-- Server/Web-integrator - Web Hosting (Kloxo-MR READY!) --

Offline Spacedust

  • Super Grand Master
  • ****
  • Posts: 4,050
  • Karma: +1/-0
    • View Profile
Re: Redirect to www does not work
« Reply #12 on: 2013-05-11, 17:58:42 »
Quote from: "MRatWork"
Your code:
Code: [Select]
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
may problem for wildcards domain (wordpress multisite need wildcards setting for dns).

Please check and confirm.
« Last Edit: 1970-01-01, 01:00:00 by Guest »

Offline MRatWork

  • Administrator
  • The Elite
  • *****
  • Posts: 15,807
  • Karma: +119/-11
  • Gender: Male
    • View Profile
    • MRatWork Forum
Re: Redirect to www does not work
« Reply #13 on: 2013-05-11, 18:05:02 »
This 'RewriteCond %{HTTP_HOST} !^www.' mean all subdomain not the same as 'www' will be redirect to 'www'.

That mean 'domain.com', 'wp1.domain.com' and others will be redirect to 'www.domain.com'.
« Last Edit: 1970-01-01, 01:00:00 by Guest »
..:: MRatWork (Mustafa Ramadhan Projects) ::..
-- Server/Web-integrator - Web Hosting (Kloxo-MR READY!) --

Offline Spacedust

  • Super Grand Master
  • ****
  • Posts: 4,050
  • Karma: +1/-0
    • View Profile
Re: Redirect to www does not work
« Reply #14 on: 2013-05-11, 18:12:35 »
Quote from: "MRatWork"
This 'RewriteCond %{HTTP_HOST} !^www.' mean all subdomain not the same as 'www' will be redirect to 'www'.

That mean 'domain.com', 'wp1.domain.com' and others will be redirect to 'www.domain.com'.

It should be:

Code: [Select]
RewriteCond %{HTTP_HOST} ^example.com$ [NC]
RewriteRule ^(.*)$ http://www.example.com/$1 [L,R=301]
« Last Edit: 1970-01-01, 01:00:00 by Guest »

 


MRatWork Affiliates:    BIGRAF(R) Inc.    House of LMAR    EFARgrafix
Click Here

Page created in 0.031 seconds with 18 queries.

web stats analysis