Pomoc - Szukaj - Użytkownicy - Kalendarz
Pełna wersja: [mod_rewrite] prosty problem
Forum PHP.pl > Forum > Przedszkole
trylik
RewriteRule ^index.php\?a=newsarch /newsy/glowna [R]

dlaczego to nie chce działać?

ma przekierować z index.php?a=newsarch na /newsy/glowna

probowalem tez:

RewriteRule ^index.php?a=newsarch /newsy/glowna [R]
RewriteRule ^index.php\?a\=newsarch /newsy/glowna [R]
RewriteRule ^(index.php\?a=newsarch) /newsy/glowna [R]
RewriteRule index.php\?a=newsarch /newsy/glowna [R]

czy moze ktos stwierdzyc czy jest to poprawnie napisane?
lectric
RewriteRule ^index.php?a=newsarch$ /newsy/glowna [R]
trylik
nietsety to tez nie dziala
lectric
Pokaż zawartość pliku .htaccess
trylik
RewriteEngine On

RewriteCond %{HTTP_HOST} ^(www\.)?ewroclaw\.invesmtap\.pl [NC]
RewriteRule ^(.*)$ http://investmap.pl/index.php?a=main&beta=tak [L]

RewriteRule ^inwestycja/.*\,([0-9]+)$ /index.php?a=main&modul=inwestycje&tryb=pokaz&id=$1
RewriteRule ^inwestycje/(biura)$ /index.php?a=main&modul=inwestycje&tryb=pokazKat&id=2
RewriteRule ^inwestycje/(domy,mieszkania)$ /index.php?a=main&modul=inwestycje&tryb=pokazKat&id=1
RewriteRule ^inwestycje/(przemysl)$ /index.php?a=main&modul=inwestycje&tryb=pokazKat&id=4
RewriteRule ^inwestycje/(handel)$ /index.php?a=main&modul=inwestycje&tryb=pokazKat&id=3
RewriteRule ^inwestycje/(logistyka)$ /index.php?a=main&modul=inwestycje&tryb=pokazKat&id=5
RewriteRule ^inwestycje/(infrastruktura)$ /index.php?a=main&modul=inwestycje&tryb=pokazKat&id=6
RewriteRule ^inwestycje/(hotele)$ /index.php?a=main&modul=inwestycje&tryb=pokazKat&id=7
RewriteRule ^inwestycje/(sport,rekreacja)$ /index.php?a=main&modul=inwestycje&tryb=pokazKat&id=8
RewriteRule ^inwestycje/(gospodarka,oparta,na,wiedzy)$ /index.php?a=main&modul=inwestycje&tryb=pokazKat&id=9
RewriteRule ^inwestycje/(remonty,zabytkow)$ /index.php?a=main&modul=inwestycje&tryb=pokazKat&id=10
RewriteRule ^inwestycje/(przetargi)$ /index.php?a=main&modul=inwestycje&tryb=pokazKat&id=11
RewriteRule ^inwestycje/(infrastruktura,spoleczna)$ /index.php?a=main&modul=inwestycje&tryb=pokazKat&id=12
RewriteRule ^polec$ /index.php?a=recommend
RewriteRule ^newsletter$ /index.php?a=addmail
RewriteRule ^wyloguj$ /index.php?a=main&modul=wyloguj
RewriteRule ^zaloguj$ /index.php?a=main&modul=wyloguj&zaloguj=tak
RewriteRule ^szukaj/wyniki$ /index.php?a=main&modul=szukaj
RewriteRule ^sky_tower_kamera_online$ /index.php?a=main&modul=kamerka
RewriteRule ^emiasto/(.*)$ /index.php?a=main&modul=emiasto&tryb=$1
RewriteRule ^mojpulpit/(.*)$ /index.php?a=main&modul=mojpulpit&tryb=$1
RewriteRule ^artykul/.*\,([0-9]+)$ /index.php?a=main&modul=artykul&id=$1
RewriteRule ^aktualnosci$ /index.php?a=newsarch&tryb=glowna
RewriteRule ^gielda/(.*)/(.*)\,.*\,(.*)$ /index.php?a=main&modul=gielda&tryb=$1&$2=$3
RewriteRule ^gielda/(.*)$ /index.php?a=main&modul=gielda&tryb=$1
RewriteRule ^wywiad/.*\,.*\,([0-9]+)/(.*)$ /index.php?a=main&modul=sylwetki&tryb=$2&id=$1
RewriteRule ^news/.*\,([0-9]+)$ /index.php?a=newsarch&tryb=pokaz&id=$1
RewriteRule ^index.php?a=newsarch$ /newsy/glowna [R]
RewriteRule ^newsy/(.*)$ /index.php?a=newsarch&tryb=$1
tzi
Cytat(trylik @ 23.01.2008, 12:13:57 ) *
RewriteRule ^index.php\?a=newsarch /newsy/glowna [R]

dlaczego to nie chce działać?

ma przekierować z index.php?a=newsarch na /newsy/glowna

probowalem tez:

RewriteRule ^index.php?a=newsarch /newsy/glowna [R]
RewriteRule ^index.php\?a\=newsarch /newsy/glowna [R]
RewriteRule ^(index.php\?a=newsarch) /newsy/glowna [R]
RewriteRule index.php\?a=newsarch /newsy/glowna [R]

czy moze ktos stwierdzyc czy jest to poprawnie napisane?

A czy nie powinno być odwrotnie tj. /newsy/glowna na index.php?a=newsarch ?
W końcu to w przeglądarce wpisujesz/klikasz link /newsy/glowna a to ma być odzwierciedleniem "phpowego wywołania" index.php?a=newsarch
W takiej sytuacji powinno być:
RewriteRule ^newsy/glowna$ /index.php?a=newsarch
trylik
kolejnosc jest ok, chodzi o to , zeby klienta ktory wejdzie na stara adresacje przekierowalo na nowa....

zobacz zreszta kolejny wpis w htacc..

Kod
RewriteRule ^index.php?a=newsarch$ /newsy/glowna [R]
RewriteRule ^newsy/(.*)$ /index.php?a=newsarch&tryb=$1
To jest wersja lo-fi głównej zawartości. Aby zobaczyć pełną wersję z większą zawartością, obrazkami i formatowaniem proszę kliknij tutaj.
Invision Power Board © 2001-2025 Invision Power Services, Inc.