Jump to content


Escape mod_rewrite for particular case


1 reply to this topic

#1 PixelHiveDesign

    Young Padawan

  • Members
  • Pip
  • 83 posts
  • Gender:Male

Posted 01 April 2007 - 10:34 AM

I currently have a .htaccess file with mod_rewrite code converting search engine friendly urls into the php vars that I need.
Example:
www.thesite.com/tutorials/3/
converts to:
www.thesite.com?section=tutorials&id=3

Thats all good, but now I have a page that I want mod_rewrite to ignore.
Example:
www.thesite.com/newpage/

convert to:
www.thesite.com/newpage/index.php

It's important that all subsections also ignore my mod_rewrite.
So: www.thesite.com/newpage/subsection/
should ignore the mod_rewrite code used for the rest of the site.

I'm searching online for the solution, probably a form of 'if statement'. If I find the solution before one is posted, I'll add it here.

Thanks in advance,

Edited by PixelHiveDesign, 01 April 2007 - 10:39 AM.


#2 PixelHiveDesign

    Young Padawan

  • Members
  • Pip
  • 83 posts
  • Gender:Male

Posted 01 April 2007 - 02:20 PM

View Post. Adam ., on Apr 1 2007, 11:49 AM, said:

Just add a new rule before all others...

RewriteRule ^newpage/$ newpage/index.php [L]

Adding [L] at the end, tells apache to ignore the other rules if this one is met.

Easy enough, thanks.





1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users