Jump to content
php.lv forumi

mod_rewrite un folderi


sandrulis

Recommended Posts

Lieta tāda man ir lapele ar admina paneli :)

 

admina panelis atrodas http://www.kautkas.lv/admin

 

bet vēl es lietoju mod_rewrite

 

RewriteEngine on
RewriteRule ^([^/\.]+)/?$ /index.php?action=$1 [L]

 

kad mēģinu ieiet admina paneli es nevaru, jo mod_rewrite uzskata to kā saisināto adresi, nevar kaut ko izdarīt ar to mod_rewrite, lai varētu lietot arī admina paneli kā ir paredzēts - reizē ar to mod_rewrite

 

paldies jau iepriekš

Link to comment
Share on other sites

Pirms RewriteRule

RewriteCond %{REQUEST_URI} !^/admin

Un ir vēl opcijas, kuras tiek bieži lietotas

RewriteCond %{REQUEST_FILENAME} !-f # nerewritot, ja tiek pieprasīts fails, kas reāli eksistē
RewriteCond %{REQUEST_FILENAME} !-d # nerewritot, ja tiek pieprasīta mape, kas reāli eksistē

Un vispār, te ir dokumentācija: http://httpd.apache.org/docs/current/mod/mod_rewrite.html

Edited by marcis
Link to comment
Share on other sites

kaut kā negrib tā strādāt, vai arī īsti nesaprati mani īsti

 

es gribu tā, lai mana lapele iet viss ka vajag iet ar šo

 

RewriteEngine on
RewriteRule ^([^/\.]+)/?$ /index.php?action=$1 [L]

 

bet kad gribu ieiet admina paneli ierakstu adresi

 

http://www.kautkas.lv/admin

 

un uz root admin panelis atrodas arī tur pat /admin/

Edited by sandrulis
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...