Small htaccess tweak

  • MasterZ
  • Expert
  • Expert
  • User avatar
  • Posts: 699
  • Loc: Colorado Springs

Post 3+ Months Ago

Hey guys, quick question.

I'm setting up a page for my podcast, and I need to redirect all incoming links to a subfolder without breaking my links to my podcast files.

Here is my directory structure:
/.htaccess
/podcast.xml
/podcast1.mp3
/podcast2.mp3
/site/index.php

I already have my site established as /site so I don't want to move it to root, how do I redirect traffic to /site without breaking access to the xml or mp3 files?

Thanks everyone.
  • joebert
  • Fart Bubbles
  • Genius
  • User avatar
  • Posts: 13504
  • Loc: Florida

Post 3+ Months Ago

You setup the rewrite like you normally would, but you add at least one RewriteCond above the RewriteRule that excludes rewrites when the REQUEST_URI matches /podcast([0-9]*\.mp3|\.xml) or depending on what else you have going on, something similar.

Code: [ Select ]
RewriteCond %{REQUEST_URI} !^/podcast([0-9]*\.mp3|\.xml)
RewriteRule ...
  1. RewriteCond %{REQUEST_URI} !^/podcast([0-9]*\.mp3|\.xml)
  2. RewriteRule ...

Post Information

  • Total Posts in this topic: 2 posts
  • Users browsing this forum: No registered users and 56 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.