Apache redirect

Discussion in 'Болталка' started by alkos, 10 Feb 2013.

  1. alkos

    alkos Moderator

    Joined:
    28 Mar 2007
    Messages:
    1,149
    Likes Received:
    292
    Reputations:
    271
    Кто знает как в апаче настроить редирект для конкретной страницы?

    Пример:
    Пользователь заходит на страницу domain.com/aaa.php?id=1000 и редиректится на domain.com/bbb.php

    Стандартная команда Redirect /aaa.php?id=1000 http://domain.com/bbb.php не срабатывает...
     
    _________________________
  2. FunOfGun

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

    Joined:
    5 Sep 2012
    Messages:
    391
    Likes Received:
    70
    Reputations:
    124
    А редиректить с php скрипта не вариант? http://php.about.com/od/learnphp/ht/phpredirection.htm
     
  3. Lestatkiy

    Lestatkiy Member

    Joined:
    27 Sep 2010
    Messages:
    40
    Likes Received:
    13
    Reputations:
    0
    .htaccess

    Redirect 301 /aaa.php?id=1000 domain.com/bbb.php
     
  4. ^NSA^

    ^NSA^ Elder - Старейшина

    Joined:
    3 Jul 2012
    Messages:
    66
    Likes Received:
    29
    Reputations:
    32
    доках так

    RewriteEngine on
    RewriteRule ^/foo\.html$ bar.html [R]
    Redirect /foo.html /bar.html
    ------------------------------------------
    Resource Moved to Another Server
    ------------------------------------------------
    RewriteEngine on
    RewriteRule ^/docs/(.+) http://new.example.com/docs/$1 [R,L]
    #With RedirectMatch
    RedirectMatch ^/docs/(.*) http://new.example.com/docs/$1
    #With RedirectMatch
    RedirectMatch ^/docs/(.*) http://new.example.com/docs/$1

    копать сюда
     
Loading...