The OpenNET Project / Index page

[ новости /+++ | форум | теги | ]




Версия для распечатки Пред. тема | След. тема
Новые ответы [ Отслеживать ]
как настроить Apache , !*! Roman, 12-Сен-04, 05:27  [смотреть все]
  • как настроить Apache , !*! ees, 18:48 , 12-Сен-04 (1)
    >как можно настроить апачи таким образом чтобы по любому запросу
    >http://mydomain.tld/something/blabla/lala (такого естественно нету)
    >но не выводилось 404 , а запускался определенный файл допустим
    >http://mydomain.tld/i.php но в строке запроса браузера все это выглядело так , будто
    >грузится http://mydomain.tld/something/blabla/lala
    >через ErrorDocument 404 не получается он просто делает редирект на другой файл
    >, а мне этого не надо , мне важно что в
    >строке запроса браузера оставался тот урл который запрашивается.


    mod_rewrite.
    http://httpd.apache.org/docs/mod/mod_rewrite.html

    • как настроить Apache , !*! Roman, 09:05 , 13-Сен-04 (2)
      • как настроить Apache , !*! lamerusha, 10:17 , 13-Сен-04 (3)
      • как настроить Apache , !*! ees, 13:46 , 13-Сен-04 (4)
        Выдержка из хелпа


        Assume the following per-directory config file:

        #
        #  /abc/def/.htaccess -- per-dir config file for directory /abc/def
        #  Remember: /abc/def is the physical path of /xyz, i.e., the server
        #            has a 'Alias /xyz /abc/def' directive e.g.
        #

        RewriteEngine On

        #  let the server know that we were reached via /xyz and not
        #  via the physical path prefix /abc/def
        RewriteBase   /xyz

        #  now the rewriting rules
        RewriteRule   ^oldstuff\.html$  newstuff.html
                                              ^^^^

        In the above example, a request to /xyz/oldstuff.html gets correctly rewritten to the physical file /abc/def/newstuff.html.

        Все делаеться регулярными выражениями




Партнёры:
PostgresPro
Inferno Solutions
Hosting by Hoster.ru
Хостинг:

Закладки на сайте
Проследить за страницей
Created 1996-2024 by Maxim Chirkov
Добавить, Поддержать, Вебмастеру