User Name
Password
AppleNova Forums » Programmer's Nook »

mod_rewrite Bafflement


mod_rewrite Bafflement
Thread Tools
noleli2
Senior Member
 
Join Date: May 2004
Location: Ann Arbor, MI
Send a message via AIM to noleli2  
Old 2008-03-09, 12:02

I recently installed Wordpress to my Dreamhost account, and I'm using Permalinks that use mod_rewrite in a .htaccess file to make them pretty. I'm also keeping the installation in a Subversion repository.

Subversion on Dreamhost is done through an http request to http://mydomain.com/svn/repo/, but the .htaccess file contains
Code:
# BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> # END WordPress
I believe that this means that if the requested file is neither an actual file nor directory in the base directory, it will get sent to index.php. I also want to exclude requests that start with /svn/, so I tried adding the line
Code:
RewriteCond %{REQUEST_URI} !^/svn/.*$
, the idea being that the RewriteRule would not apply to /svn/ requests.

This didn't work, but I found in the Dreamhost wiki an explanation of how to make other "special" pages that they run (/stats, etc.). They said to add
Code:
RewriteCond %{REQUEST_URI} ^/(stats/|missing\.html|failed_auth\.html) [NC] RewriteRule . - [L]
above the WordPress stuff, which made sense. I changed
Code:
^/(stats/|missing\.html|failed_auth\.html)
to
Code:
^/svn/.*
, but that did not work.

However, when I left their condition as is, /svn/worked as expected!

Does anyone have any ideas why that might be the case? That /svn/ requests work fine when the condition is for /stats/ and those other files, but not whet it's actually for /svn/?

I'm pleased that I have it working, but baffled that it works.
noleli2 is offline   quote
noleli2
Senior Member
 
Join Date: May 2004
Location: Ann Arbor, MI
Send a message via AIM to noleli2  
Old 2008-03-18, 07:07

Nobody?
noleli2 is offline   quote
Gargoyle
http://ga.rgoyle.com
 
Join Date: May 2004
Location: In your dock hiding behind your finder icon!
Send a message via AIM to Gargoyle Send a message via MSN to Gargoyle Send a message via Skype™ to Gargoyle 
Old 2008-03-22, 17:42

I use these when I am making zend framework apps...
Code:
RewriteEngine On RewriteCond %{REQUEST_URI} !/scripts.* RewriteCond %{REQUEST_URI} !/images.* RewriteCond %{REQUEST_URI} !/styles.* RewriteRule .* index.php php_flag magic_quotes_gpc off php_flag register_globals off
Gargoyle is offline   quote
Posting Rules Navigation
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Reply

Forum Jump
Thread Tools


All times are GMT -5. The time now is 22:19.


Powered by vBulletin®
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Copyright ©2004 - 2010, AppleNova
AppleNova Slim