Help with RewriteCond / RewriteCond

  • dasnter3k
  • Born
  • Born
  • dasnter3k
  • Posts: 1

Post 3+ Months Ago

Hi I am trying to implement good rules in apache so that if a file does not exist in attempting to parent dir recursively until you find it and as a last option in a specific dir. That is, if we try aceder / dir1/dir2/dir3/index.php and there to do a rewrite [L, QSA] a / dir1/dir2/index.php if any, or if no / dir1/index.php and if there is to be / standard / index. php

In principle I have it running than any dir if no such file to be / standard / index.php with

RewriteCond% (DOCUMENT_ROOT) / $ 1 / $ 2!-F
RewriteRule /(.+)/(.*)$ / standard / $ 2 [L, QSA]

but now I got the middle of the first look at the other dirs in principle should be something?

RewriteCond% (DOCUMENT_ROOT) / $ 1 / $ 2 / $ 3 / $ 4! -F
/([^/]+)/([^/]+)/([[^/]]*)/([[^/]]*)$ RewriteRule / $ 2 / $ 4 [L, QSA]

RewriteCond% (DOCUMENT_ROOT) / $ 1 / $ 2 / $ 3!-F
/([^/]+)/([^/]+)/([[^/]]*)$ RewriteRule / $ 1 / $ 3 [L, QSA]

RewriteCond% (DOCUMENT_ROOT) / $ 1 / $ 2!-F
RewriteRule /([^/]+)/([[^/]]*)$ / section / $ 2 [L, QSA]

but not...

Anyone can lend a hand, thanks!
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

Post Information

  • Total Posts in this topic: 1 post
  • Users browsing this forum: No registered users and 116 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.