Po ponad godzinnej próbie znalezienia rozwiązania wysiadłem i postanowiłem zapytać się fachowców...
Mam problem z simple url'ami, mianowicie, strona główna ma mod rewrite wyglądający mniej więcej tak:
Kod
RewriteEngine On
RewriteRule ^([^/]*)\.html$ /index.php?id=$1 [NC,L,QSA]
RewriteRule ^([^/]*)/([^/]*)\.html$ /index.php?id=$1&el=$2 [NC,L,QSA]
RewriteRule ^([^/]*)/([^/]*)/([^/]*)\.html$ /index.php?id=$1&el=$2&kat=$3 [NC,L,QSA]
RewriteRule ^([^/]*)\.html$ /index.php?id=$1 [NC,L,QSA]
RewriteRule ^([^/]*)/([^/]*)\.html$ /index.php?id=$1&el=$2 [NC,L,QSA]
RewriteRule ^([^/]*)/([^/]*)/([^/]*)\.html$ /index.php?id=$1&el=$2&kat=$3 [NC,L,QSA]
Czyli prezentuje url w postaci www.mojastrona.pl/a/b/c.html
Wszystko ładnie i pięknie, lecz gdy w panelu administracyjnym (www.mojastrona.pl/panel_administracyjny/ <- strona panelu wyświetla się tak jak powinna) mój htaccess wygląda tak:
Kod
RewriteEngine On
RewriteRule ^([^/]*)\.do$ /index.php?dana=$1 [NC,L,QSA]
RewriteRule ^([^/]*)-([^/]*)\.do$ /index.php?dana=$1&id=$2 [NC,L,QSA]
RewriteRule ^([^/]*)-([^/]*)-([^/]*)\.do$ /index.php?dana=$1&id=$2&el=$3 [NC,L,QSA]
RewriteRule ^([^/]*)\.do$ /index.php?dana=$1 [NC,L,QSA]
RewriteRule ^([^/]*)-([^/]*)\.do$ /index.php?dana=$1&id=$2 [NC,L,QSA]
RewriteRule ^([^/]*)-([^/]*)-([^/]*)\.do$ /index.php?dana=$1&id=$2&el=$3 [NC,L,QSA]
Czyli w teorii powinno to działać tak: www.mojastrona.pl/panel_administracyjny/a.do
Lecz w praktyce wygląda to tak iż ładuje się strona główna (www.mojastrona.pl).
Zapewne wypadało by zmienić rozpoznawanie url'a w htacces strony głównej zmieniając "/" w getach, lecz cała zabawa polega na tym iż musi to tak zostać.
Proszę o pomoc.
---------EDIT-----------
Problem rozwiązany, wystarczyło zrobić tak:
Kod
RewriteEngine On
RewriteBase /
RewriteRule ^([^/]*)\.html$ /index.php?id=$1 [NC,L,QSA]
RewriteRule ^([^/]*)/([^/]*)\.html$ /index.php?id=$1&el=$2 [NC,L,QSA]
RewriteRule ^([^/]*)/([^/]*)/([^/]*)\.html$ /index.php?id=$1&el=$2&kat=$3 [NC,L,QSA]
RewriteRule ^([^/]*)\.do$ /panel/index.php?dana=$1 [NC,L,QSA]
RewriteRule ^([^/]*)/([^/]*)\.do$ /panel/index.php?dana=$1&id=$2 [NC,L,QSA]
RewriteRule ^([^/]*)/([^/]*)/([^/]*)\.do$ /panel/index.php?dana=$1&id=$2&el=$3 [NC,L,QSA]
RewriteBase /
RewriteRule ^([^/]*)\.html$ /index.php?id=$1 [NC,L,QSA]
RewriteRule ^([^/]*)/([^/]*)\.html$ /index.php?id=$1&el=$2 [NC,L,QSA]
RewriteRule ^([^/]*)/([^/]*)/([^/]*)\.html$ /index.php?id=$1&el=$2&kat=$3 [NC,L,QSA]
RewriteRule ^([^/]*)\.do$ /panel/index.php?dana=$1 [NC,L,QSA]
RewriteRule ^([^/]*)/([^/]*)\.do$ /panel/index.php?dana=$1&id=$2 [NC,L,QSA]
RewriteRule ^([^/]*)/([^/]*)/([^/]*)\.do$ /panel/index.php?dana=$1&id=$2&el=$3 [NC,L,QSA]
--------EDIT2--------
A jednak nie jest rozwiązany, w panelu jak wywołam:
to $_GET[dana] przyjmuje wartość "panel"...
Jakieś pomysły?