apache mod rewrite
i want to force ssl on certain pages:
like if the request is http://thepage.com i want to rewrite it so that its https://thepage.com what would the re-write rule look like for something like that....i dont know how to write the rules. |
Should work, but it's untested. So let me know.
edit.. Put that in a .htaccess file btw |
no go, didnt kick out any errors, just didnt work. im reading up on regexes though.
edit. just saw your edit on .htaccess, gotta try it again. |
well, which .htaccess file?
the specific site is this (all permutations that i want to change) http://robert.dynu.net/horde/imp http://robert.dynu.net/horde http://robert.dynu.net/horde/imp/login.php actually i guess you could just say: http://robert.dynu.net/horde <<<< anything that begins with that i want to default exactly to : Code:
https://robert.dynu.net/horde/imp/login.php i want to force secure login to the email system. feel free to check out the link, you can get horde and imp from http://horde.org |
.just wanted to bump it up incase someone knew. last time i'll bump this though.
|
I did some googling and found this solution:
Code:
RewriteEngine on [edit]I should give credit to this webpage: http://list.cobalt.com/pipermail/cob...er/033818.html for the solution above. The first example shown is what I used, but I modified it first to eliminate the RewriteBase command which I found was not needed (by process of elimination) and I also found that I could use the REQUEST_URI environment variable like I do in CGI scripts to insert whatever document path and name was requested, whereas the original example on that page had you changing the directory. I'd much rather have something that you just drop in and works rather than having to change it depending on what directory you happen to put it in! You may want to try the version on the linked page if mine doesn't work on your hosting provider, since your host may set different environment variables or set them differently than mine (which is http://www.bluevirtual.com).[/edit] |
All times are GMT -5. The time now is 03:40 AM. |