Forum Moderators: phranque

Message Too Old, No Replies

RedirectMatch all requests to a particular subdir

         

verbalicious

10:33 pm on Jul 28, 2009 (gmt 0)

10+ Year Member



I have a SSL vhost whose only purpose is to serve up our Confluence wiki. I've arrived at a solution that works for our redirection needs, but I want to be sure I understand how it's working. I'd like anyone who types in [subdomain.ourdomain.com...] to be redirected to [subdomain.ourdomain.com...]

RedirectMatch permanent ^/(.*)$ [subdomain.ourdomain.com...]

ProxyPass /appname [127.0.0.1:8180...]
ProxyPassReverse /appname [127.0.0.1:8180...]

I'd like to force any visitors going to the site that isn't appname to be sent to appname. This achieves this, but my question is this: Is this inefficient? Is it doing 301's for every HTTP request even when the user is already using appname and inside of Confluence? I hope this clear! Thanks!

jdMorgan

11:29 am on Jul 29, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Consider using mod_rewrite, and using RewriteConds to check to see if the protocol and domain are already "https" and "subdomain", and that the URL-does not already start with "appname" before redirecting.

Also, consider whether youa actually want to expose "appname" in the URL using a redirect, or whether an internal rewrite to the proxied path would be more appropriate.

With this scheme as currently described, "appname" will also have to handle requests for robots.txt, SiteMap.xml, images, and all other included objects, etc.

Jim

Caterham

8:03 pm on Jul 29, 2009 (gmt 0)

10+ Year Member



Is it doing 301's for every HTTP request even when the user is already using appname
mod_proxy's translate_name hook registers APR_HOOK_FIRST, mod_alias APR_HOOK_MIDDLE, so no, no loop here.