Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> .htaccess, przekierowanie na index.php za wyjątkiem
AxZx
post 25.05.2009, 14:53:15
Post #1





Grupa: Zarejestrowani
Postów: 1 385
Pomógł: 55
Dołączył: 1.03.2005
Skąd: śląsk

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


witam

w symfony jest domyślnie taki plik .htaccess
Kod
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 controller  
  RewriteRule ^(.*)$ index.php [QSA,L]
</IfModule>


plik .htaccess jest w katalogu razem z plikiem index.php, katalogami css, js, img etc.
wrzuciłem tam też katalog phpmyadmin wraz z zawartością.
można coś zrobić, żeby phpmyadmin działał normalnie po wpisaniu w url localhost/phpmyadmin ?
żeby nie przekierowywał na index.php

pozdrawiam


--------------------
aplikacje internetowe | Symfony
Go to the top of the page
+Quote Post
erix
post 26.05.2009, 17:12:53
Post #2





Grupa: Moderatorzy
Postów: 15 467
Pomógł: 1451
Dołączył: 25.04.2005
Skąd: Szczebrzeszyn/Rzeszów




Cytat
można coś zrobić, żeby phpmyadmin działał normalnie po wpisaniu w url localhost/phpmyadmin ?
żeby nie przekierowywał na index.php

Strzelam w ciemno: Przed każdym RewriteRule dopisz:
Kod
RewriteCond %{REQUEST_FILENAME} !-d


--------------------

ZCE :: Pisząc PW załączaj LINK DO TEMATU i TYLKO w sprawach moderacji :: jakiś błąd - a TREŚĆ BŁĘDU? :: nie ponaglaj z odpowiedzią via PW!
Go to the top of the page
+Quote Post
AxZx
post 26.05.2009, 17:30:01
Post #3





Grupa: Zarejestrowani
Postów: 1 385
Pomógł: 55
Dołączył: 1.03.2005
Skąd: śląsk

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


Cytat(erix @ 26.05.2009, 18:12:53 ) *
Strzelam w ciemno: Przed każdym RewriteRule dopisz:
Kod
RewriteCond %{REQUEST_FILENAME} !-d


raczej zły strzał, bo to ma być tylko katalog phpmyadmin. reszta ma działać normalnie.


--------------------
aplikacje internetowe | Symfony
Go to the top of the page
+Quote Post
erix
post 26.05.2009, 17:37:24
Post #4





Grupa: Moderatorzy
Postów: 15 467
Pomógł: 1451
Dołączył: 25.04.2005
Skąd: Szczebrzeszyn/Rzeszów




Aha, w ten sposób.
Kod
RewriteCond %{REQUEST_URI} !(phpmyadmin)


--------------------

ZCE :: Pisząc PW załączaj LINK DO TEMATU i TYLKO w sprawach moderacji :: jakiś błąd - a TREŚĆ BŁĘDU? :: nie ponaglaj z odpowiedzią via PW!
Go to the top of the page
+Quote Post
AxZx
post 26.05.2009, 18:50:15
Post #5





Grupa: Zarejestrowani
Postów: 1 385
Pomógł: 55
Dołączył: 1.03.2005
Skąd: śląsk

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


dzięki wielkie:)

Kod
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)
  RewriteCond %{REQUEST_URI} !(phpmyadmin)
  RewriteRule ^$ index.html [QSA]
  RewriteCond %{REQUEST_URI} !(phpmyadmin)
  RewriteRule ^([^.]+)$ $1.html [QSA]
  
  RewriteCond %{REQUEST_URI} !(phpmyadmin)
  RewriteCond %{REQUEST_FILENAME} !-f

  # no, so we redirect to our front web controller  
  RewriteRule ^(.*)$ index.php [QSA,L]
</IfModule>


możliwe, że da się to inaczej zapisać, ale to tylko na dev maszynie - grunt żeby działało:)


--------------------
aplikacje internetowe | Symfony
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: 15.05.2025 - 13:13