Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> .htaccess, przekierowanie na index.php za wyjątkiem
AxZx
post
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
Go to the top of the page
+Quote Post
erix
post
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
Go to the top of the page
+Quote Post
AxZx
post
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.
Go to the top of the page
+Quote Post
erix
post
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)
Go to the top of the page
+Quote Post
AxZx
post
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:)
Go to the top of the page
+Quote Post

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

 



RSS Aktualny czas: 14.09.2025 - 23:59