[thelist] SOLVED: htaccess mod_rewrite help please!!!

Stephen Rider evolt_org at striderweb.com
Wed Oct 4 23:41:04 CDT 2006


This, in the blog directory (not root directory) did the trick:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_URI} ^(/blog|/otherblog)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . %1/index.php [L]
</IfModule>

Very similar to David's suggestion.  Actually, I'm not sure why  
David's suggestion didn't work.  He lead me in certain directions, I  
bounced around the web a few times looking things up and trying  
various permutations, and when it finally worked I realized I had  
gone the long way around and was back very close to what was  
suggested.  :)

Thanks for the help!

Steve

On Oct 3, 2006, at 10:58 PM, David Kaufman wrote:

> Stephen Rider <evolt_org at striderweb.com> wrote:
>> ...in one directory /blog/ and a symbolic link,
>> /blog2/ (and /blog3/, /blog4/...) that points to the /blog/
>> directory...
>>
>> I want to tell the [mod_rewrite] block, essentially, "If the
>> directory structure starts with /blog/, point to /blog/index.php.
>> If it starts with /blog2/ point to /blog2/index.php
>
> You need to remove their rewrite rule
> in the /blog/ dir, modify it and place it in an .htaccess file one
> directory *up*, in this case, the document root of your site.
>
> Try this, in /.htaccess
>
> RewriteEngine On
> RewriteCond %{REQUEST_URI}        ^/blog([0-9]*)/
> RewriteCond %{REQUEST_FILENAME}   !-f
> RewriteCond %{REQUEST_FILENAME}   !-d
> RewriteRule .                     /%1/index.php [L]





More information about the thelist mailing list