- Code: Select all
www2.domain.edu/~username
I have created some rewrite rules to send all visitors, regardless of what url they try, to the fancy dns name:
- Code: Select all
username.domain.edu/
All well and good. Works beautifully. It successfully redirects www2.../~username to username.domain.edu, and it successfully strips off any leading www. they try to put in there. I first do the redirect, then the RewriteCond for www. followed by the RewriteRule.
Here's the problem. Some of our sites use scripting that lives in a /cgi-bin/ directory at the root of the public html directory. This scripting breaks when the redirect is in force. Essentially, for the scripting to work, the request must be to:
- Code: Select all
www2.domain.edu/~uername/cgi-bin/whatever.php
With the redirect in place, it tries to go to:
- Code: Select all
username.domain.edu/cgi-bin/whatever.php
And as there is nothing there, it fails.
So, after my initial redirect and my www stripping, I want to then redirect any requests for /cgi-bin/.* back to www2.domain.edu/~username/cgi-bin/.*
I have tried what I think should work, but it doesn't. Actually, I've tried fourteen things I think should work.
Can anyone set me on the right path?
Thanks,
Danny.