Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [Apache] mod_rewrite problem http://serwer.pl/user, problem z redirectami
matchor
post
Post #1





Grupa: Zarejestrowani
Postów: 46
Pomógł: 0
Dołączył: 1.05.2005

Ostrzeżenie: (0%)
-----


czesc
namieszalem sie troche z redirectami i nie moge sobie z tym dac rady.

Otoz mam plik httaccess w postacj jak ponizej ktory zachowuje sie tak

http:/ /serwer.pl/x/1,2,index.html => http:/ /serwer.pl/index.html.php?ARG1=1&ARG2=2
http:/ /serwer.pl/x/1,3,5,cokolwiek.html => http:/ /serwer. pl/index.html.php?ARG1=1&ARG2=3&ARG3=5&ARG4=cokolwiek.html

http:/ /serwer .pl/ 1,2, jakisplik.html => http :// serwer.pl/ jakisplik.html.php ?ARG1=1 &ARG2=2
http:/ /serwer .pl/ 1,4,2, innyplik.xml => http :// serwer.pl/ innyplik.xml.php ?ARG1=1 &ARG2=4 &ARG2=2

  1. Options +FollowSymlinks
  2. RewriteEngine on
  3.  
  4. RewriteBase /
  5.  
  6. RewriteCond %{REQUEST_FILENAME} !-f
  7. RewriteCond %{REQUEST_FILENAME} !-d
  8.  
  9. RewriteRule ^x/([^-]+)/([^-]+)/([^-]+)/([^-]+)/([^-]+)$ index.html.php?ZZZ1=$1&ZZZ2=$2&ZZZ3=$3&ZZZ4=$4&ZZZ5=$5 [L]
  10. RewriteRule ^x/([^-]+),([^-]+),([^-]+),([^-]+)$ index.html.php?ZZZ1=$1&ZZZ2=$2&ZZZ3=$3&ZZZ4=$4 [L]
  11. RewriteRule ^x/([^-]+),([^-]+),([^-]+)$ index.html.php?ZZZ1=$1&ZZZ2=$2&ZZZ3=$3 [L]
  12. RewriteRule ^x/([^-]+),([^-]+)$ index.html.php?ZZZ1=$1&ZZZ2=$2 [L]
  13.  
  14. RewriteCond %{REQUEST_URI} !.*\.(php|xml)
  15. RewriteRule ^(.*),(.*),(.*),(.*\.)(html|xml)$ $4$5.php?ARG1=$1&ARG2=$2&ARG3=$3 [L]
  16. RewriteRule ^(.*),(.*),(.*\.)(html|xml)$ $3$4.php?ARG1=$1&ARG2=$2 [L]
  17. RewriteRule ^(.*),(.*\.)(html|xml)$ $2$3.php?ARG1=$1 [L]
  18. RewriteRule ^(.*\.)(html|xml|)$ $1$2.php [L]


Wszystko OK ale chcialnym zamienic tego x na dowolny ciag i przekazywac w jego miejsce nazwe uzytkownika tak zeby link byly w postaci :

http:/ /serwer .pl/nazwa_usera => http:/ /serwer. pl/index.html?user=nazwa_usera
http:/ /serwer .pl/nazwa_usera/ => http:/ /serwer. pl/index.html?user=nazwa_usera

http:/ /serwer. pl/nazwa_usera/x/0,0,cokolwiek.html => http:/ /serwer. pl/index.html?user=nazwa_usera&ARG1=0&ARG2=0&ARG3=cokolwiek.html

http:/ /serwer.pl/1,2,jakisplik.html => http:/ /serwer.pl/jakisplik.html.php?ARG1=1&ARG2=2
http:/ /serwer.pl/1,4,2,innyplik.xml => http:/ /serwer.pl/innyplik.xml.php?ARG1=1&ARG2=4&ARG2=2


CZY KTOS BYLBY W STANIE MI POMOC I POWIEDZIEC / DORADZIC CO ZMODYFIKOWAC I JAK ZEBY TO ZADZIALALO W TEN SPOSOB questionmark.gif BARDZO PROSZE O POMOC

Ten post edytował matchor 5.08.2008, 00:05:22
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 21.08.2025 - 12:19