Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [Apache][.htaccess] Przejmowanie argumentow. Czy da sie to zrobic prosciej?
matchor
post 15.03.2008, 18:10:57
Post #1





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

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


Witam czy da sie ten kod jakos zoptymalizowac??
Zalezy mi na tym zeby pliki html ewentualnie jeszcze xml mialy dodawane rozszerzenie.php oraz zeby argumenty przed nazwa pliku byly interpretowane przez phpa

Czyli http://serwer/arg1, arg2, arg3, arg4,test.html
byl widziany przez serwer jako
http://serwer/test.html.php?a=arg1&b=a...arg3&d=arg4

oto moj kod.

Options +FollowSymlinksRewriteEngine onRewriteBase /RewriteCond %{REQUEST_FILENAME} !-fRewriteCond %{REQUEST_FILENAME} !-d#bez argumentowRewriteCond %{REQUEST_URI} .*\.(html)RewriteCond %{REQUEST_URI} !.*\.(php)RewriteCond %{REQUEST_URI} !(.*),(.*)RewriteRule ^(.*)$ $1.php [L]#4argumentyRewriteCond %{REQUEST_URI} .*\.(html)RewriteCond %{REQUEST_URI} !.*\.(php)RewriteCond %{REQUEST_URI} (.*),(.*),(.*),(.*),(.*)RewriteRule ^(.*),(.*),(.*),(.*),(.*)$ $5.php?ARG1=$1&ARG2=$2&ARG3=$3&ARG4=$4 [L]#3argumentyRewriteCond %{REQUEST_URI} .*\.(html)RewriteCond %{REQUEST_URI} !.*\.(php)RewriteCond %{REQUEST_URI} (.*),(.*),(.*),(.*)RewriteRule ^(.*),(.*),(.*),(.*)$ $4.php?ARG1=$1&ARG2=$2&ARG3=$3 [L]#2argumentyRewriteCond %{REQUEST_URI} .*\.(html)RewriteCond %{REQUEST_URI} !.*\.(php)RewriteCond %{REQUEST_URI} (.*),(.*),(.*)RewriteRule ^(.*),(.*),(.*)$ $3.php?ARG1=$1&ARG2=$2 [L]#1argumentRewriteCond %{REQUEST_URI} .*\.(html)RewriteCond %{REQUEST_URI} !.*\.(php)RewriteRule ^(.*),(.*)$ $2.php?ARG1=$1" title="Zobacz w manualu PHP" target="_manual
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 Wersja Lo-Fi Aktualny czas: 24.07.2025 - 12:46