Сделать редирект через .htaccess

Discussion in 'PHP' started by m-Xacker, 21 Nov 2009.

  1. m-Xacker

    m-Xacker Elder - Старейшина

    Joined:
    17 Jun 2008
    Messages:
    111
    Likes Received:
    10
    Reputations:
    0
    Здравствуйте!

    Подскажите как сделатиь редирект не на www.site.ru как показано в коде , а наоборот на site.ru

    HTML:
    RewriteEngine on
    RewriteCond %{HTTP_HOST} !^www\.
    RewriteCond %{REQUEST_URI} !^/robots\.txt$
    RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
     
    #1 m-Xacker, 21 Nov 2009
    Last edited: 21 Nov 2009
  2. Belov

    Belov Elder - Старейшина

    Joined:
    4 Aug 2008
    Messages:
    35
    Likes Received:
    5
    Reputations:
    0
    Code:
    RewriteEngine on
    RewriteCond %{HTTP_HOST} ^www.vash_sait\.ru$ [NC]
    RewriteCond %{REQUEST_URI} !^/robots\.txt$
    RewriteRule ^(.*)$ http://vash_sait.ru/$1 [R=301,L]
    надо просто исправить, вот попробуй

    Ps. не забудь изменить "vash_sait"
     
    1 person likes this.
  3. Flanker48

    Flanker48 Member

    Joined:
    9 Mar 2009
    Messages:
    74
    Likes Received:
    33
    Reputations:
    0
    Code:
    Redirect temp http://www.site.ru http://site.ru
     
  4. MiruMir

    MiruMir New Member

    Joined:
    13 Dec 2009
    Messages:
    0
    Likes Received:
    1
    Reputations:
    0
    Redirect / http://www.site.ru http://site.ru /?

    так тоже катит !
     
Loading...