- domena.pl
-cms.domena.pl
obydwie są skierowane na katalog web
Jak ma wyglądać htaccess zeby po wejściu na cms.domena.pl odpalał się backend.php
a po wejściu na domena.pl index.php
Obecny htaccess w katalogu web:
Options +FollowSymLinks +ExecCGI <IfModule mod_rewrite.c> RewriteEngine On # uncomment the following line, if you are having trouble # getting no_script_name to work #RewriteBase / # we skip all files with .something #RewriteCond %{REQUEST_URI} \..+$ #RewriteCond %{REQUEST_URI} !\.html$ #RewriteRule .* - [L] # we check if the .html version is here (caching) RewriteRule ^$ index.html [QSA] RewriteRule ^([^.]+)$ $1.html [QSA] RewriteCond %{REQUEST_FILENAME} !-f # no, so we redirect to our front web RewriteCond %{HTTP_HOST} ^domena.pl(.*) [NC] RewriteRule ^(.*)$ index.php [QSA,L] RewriteCond %{HTTP_HOST} ^cms.domena.pl(.*) [NC] RewriteRule ^(.*)$ backend.php [QSA,L] </IfModule>
niby działa ale symfony gubi ścieżki do css zawsze dla drugiego wpisu. Proszę o pomoc.
Dobra znalazłem formułkę która rozwiązuje problem....
# no, so we redirect to our front web RewriteCond %{HTTP_HOST} ^cms.domena.pl(.*) [NC] RewriteRule ^(.*)$ backend.php [QSA,L] RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ index.php [QSA,L]
w takiej kolejności jakiej jest napisane. Virtual hosty obydwu domen kierujemy na katalog web/ a htaccess załatwi sprawę i w zależności od domeny będzie uruchamiał tego kontrolera którego chcemy....przy tym wpisie nie gubi ścieżek...