Apache Redirect within public_html (~username)

Michael Torrie torriem at gmail.com
Fri Apr 30 10:57:43 MDT 2010


On 04/30/2010 10:42 AM, Scott Edwards wrote:
>> How would the rule look within the context of ~torriem?  Do I just have
>> to make the pattern include ~torriem/pagename.html?
> 
> With rewritebase.  try junk in the .htaccess to make sure it throws a
> 500.  This simple test will ensure your .htaccess is even being used.

Got it.  Thanks for the tip.  With this and a bit of reading Apache's
documentation, this is what I came up with:

RewriteEngine On
RewriteBase /~torriem/
RewriteRule ^blah$ wiki/blah [NC,R=301,L]
RewriteRule ^blah/.*$ wiki/blah [NC,R=301,L]

I did two rules depending on whether someone went to just blah, blah/ or
blah/index.html (depending on bookmarks, etc).

The speed at which my pages load seems to be acceptable.  I know
.htaccess was already operating because dokuwiki uses it to turn on
clean urls.


More information about the PLUG mailing list