Forum Moderators: phranque

Message Too Old, No Replies

rewrite URL for ssl redirect

         

Shanna7463

12:02 am on Nov 14, 2007 (gmt 0)

10+ Year Member



Hi I currently have my httpd.conf file set up with a ProxyPass so that when you hit [mysite.com...] you are redirected to [mysite.com:9000...]

I'm trying to do a rewrite, so that the URL in the browser doesn't show the redirect URL (should continue to show [mysite.com...] after you've been redirected)

These are the configurations I have in my httpd.conf file:

<Directory "C:/JOnAS-4.8.4/BSOA_base/webapps/autoload/myfile">
Options FollowSymLinks
RewriteEngine On
AllowOverride All
Order allow,deny
Allow from all
RewriteCond %{SERVER_PORT}!^443$
RewriteRule ^/(.*)$ [%{SERVER_NAME}...] [L,R]
</Directory>

ProxyPass /myfile [localhost:9000...]
ProxyPassReverse /myfile [localhost:9000...]

However this doesn't work. Apache is listening on port 443 and 80, and Jonas is running on 9000 (running the myfile webapp).

Thanks for any suggestions!

-- Shanna --

jdMorgan

4:06 pm on Nov 14, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I'm a bit confused by the mixed terminology here -- redirect vs. rewrite vs. proxy through-put. But note that if you want the output of mod_rewrite to be further processed by another module (such as mod_proxy), then you should use the [PT] flag on your RewriteRule. Without [PT], mod_rewrite will output an internal filepath when doing an internal rewrite, while using [PT] makes it output a URL.

Jim

Shanna7463

4:37 pm on Nov 14, 2007 (gmt 0)

10+ Year Member



Sorry for the confusion, I'm still pretty new to Apache.

So I'm NOT doing a redirect, I'm using a proxy to forward my requests from [mysite.com...] to [mysite.com:9000...] I'm trying to use mod_rewrite to manipulate the URL so that it does not show the new URL (I want it to always show [mysite.com...]

Is this possible?

Thanks!

-- Shanna --

[edited by: Shanna7463 at 4:38 pm (utc) on Nov. 14, 2007]

Shanna7463

5:25 pm on Nov 14, 2007 (gmt 0)

10+ Year Member



oops nevermind, using the PT flag worked! Thank you! :)

-- Shanna --