[wplug] Apache Redirects / Rewrites

Neal Sofge neal_sofge at rand.org
Tue Nov 13 11:19:16 EST 2007


Use a two-line conditional like this:

RewriteCond !^domain.tld/wiki/(.*)$
RewriteRule ^domain.tld/(.*)$ domain.tld/wiki/$1 [R]

I'm doing this out of my head, so the syntax might be a bit off, but  
the idea is that the rewrite only kicks in if the conditional is  
true, and the bang in front ensures that this only happens if the URL  
doesn't match the pattern you gave.


On Nov 11, 2007, at 10:53 PM, Michael Semcheski wrote:

> Hey Everybody,
>
> I'm trying to setup Apache2 and Mediawiki.  The wiki is to be  
> accessible at:
> domain.tld/wiki/WikiPage
>
> To do this, I've got some rewrite rules that rewrite
> domain.tld/wiki/WikiPage to domain.tld/wiki/index.php?title=WikiPage
>
> That seems to be working, and provided it is and everybody's happy,
> then life is good.
> But of course, I want to do a little more.
>
> What I want to do is redirect requests that aren't to the wiki -
> anything not of the form domain.tld/wiki/(.*)$ to a wiki page of the
> same name.  In other words:
> domain.tld/lists  --> domain.tld/wiki/lists
>
> Can anyone tell me how to do this, and save me some time?
>
> Thanks,
>
> Mike
> _______________________________________________
> wplug mailing list
> wplug at wplug.org
> http://www.wplug.org/mailman/listinfo/wplug



--
Neal Sofge, Web Technology Analyst
RAND Corporation <http://www.rand.org/>



--------------------

This email message is for the sole use of the intended recipient(s) and
may contain privileged information. Any unauthorized review, use,
disclosure or distribution is prohibited. If you are not the intended
recipient, please contact the sender by reply email and destroy all copies
of the original message.




More information about the wplug mailing list