LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
Search this Thread
Old 04-09-2013, 02:07 AM   #1
linuxlover.chaitanya
Senior Member
 
Registered: Apr 2008
Location: Nagpur, India
Distribution: Cent OS 5/6, Ubuntu Server 10.04
Posts: 4,627

Rep: Reputation: Disabled
Apache URL rewriting


Hello all,

We have a requirement where we need forward a internal URL to external HTTPS link. This HTTPS link is our exchange outlook web access. I have tried ReverseProxy and URL rewrite and redirect. Though the redirection is working in these cases, the URL on the client end browser changes to the original which is not what I want.

This is what I tried:

Code:
ProxyPass /app1/ https://<our-link>/owa/
ProxyPassReverse /app1/ https://<our-link>/owa/

<Location ~ "^/(app1/)">
        SSLRequireSSL
</Location>
This actually redirects the /app1/ but the original URL is visible on the client browser.

and

Code:
RewriteEngine on
RewriteRule ^/app1/(.+) https://<our-link>/owa/$1 [R,L]
This does not work at all. But I find this method promising as the error I get is /app1/ not found on the server.

Is there any way of doing what I want to?
 
Old 04-10-2013, 11:57 AM   #2
vishesh
Member
 
Registered: Feb 2008
Distribution: Fedora,RHEL,Ubuntu
Posts: 649

Rep: Reputation: 66
Can you try with

RewriteRule ^/app1/([A-Z_a-z\.?&=]*)$ https://<our-link>/owa/$1 [R=301]

As it seems that GET or POST data not getting passed correctly.

Thanks
 
Old 04-13-2013, 06:22 AM   #3
linuxlover.chaitanya
Senior Member
 
Registered: Apr 2008
Location: Nagpur, India
Distribution: Cent OS 5/6, Ubuntu Server 10.04
Posts: 4,627

Original Poster
Rep: Reputation: Disabled
Does not seem to be working the way I want it to. The client URL still changes to the redirected one.
 
Old 04-14-2013, 12:27 AM   #4
linuxlover.chaitanya
Senior Member
 
Registered: Apr 2008
Location: Nagpur, India
Distribution: Cent OS 5/6, Ubuntu Server 10.04
Posts: 4,627

Original Poster
Rep: Reputation: Disabled
I seem to have got ahead with something but not working exactly I would like it to be.
Following is the configuration that has got me some further not to the destination though.

Code:
<VirtualHost 10.10.8.175:443>
        ServerName 10.10.8.175:443
        SSLEngine On
        SSLProxyEngine On
        SSLCertificateFile /etc/pki/tls/certs/localhost.crt
        SSLCertificateKeyFile /etc/pki/tls/private/localhost.key

        ProxyPass /app1/ https://<our-link>/owa/
        ProxyPassReverse /app1/ https://<our-link>/owa/

        <Location ~ "^/(app1/)">
                SSLRequireSSL
        </Location>


        ProxyPass /app2/ http://www.ourdomain.com/
        ProxyPassReverse /app2/ http://www.ourdomain.com/

        <Location ~ "^/(app2/)">
                SSLRequireSSL
        </Location>
</VirtualHost>
The /app2/ works for me but /app1/ does not. I get only a blank page.

Following is the error I see in the logs for /app1/

Code:
File does not exist: /var/www/html/owa, referer: https://10.10.8.175/app1/auth/logon.aspx?url=https://<our-link>/owa/&reason=0
I dont understand why it is referring to the local file when it is configured to only refer the exchange web access link.

Any help would be much appreciated.

Last edited by linuxlover.chaitanya; 04-14-2013 at 12:28 AM.
 
Old 05-07-2013, 03:42 AM   #5
linuxlover.chaitanya
Senior Member
 
Registered: Apr 2008
Location: Nagpur, India
Distribution: Cent OS 5/6, Ubuntu Server 10.04
Posts: 4,627

Original Poster
Rep: Reputation: Disabled
Resolved the issue by just changing the Virtual Directory to /owa/. Strange but true.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Automatic path (not URL) rewriting with apache? Zippy1970 Linux - Server 2 12-28-2011 07:51 PM
LXer: How I Solved a URL Rewriting Issue with Apache LXer Syndicated Linux News 0 11-19-2011 11:50 AM
URL Rewriting in htaccess hatchnet Linux - General 7 07-05-2010 05:57 PM
URL Rewriting mrpraveen.p Linux - Newbie 1 06-03-2008 07:07 AM
URL Rewriting getmeontop Linux - Newbie 1 04-02-2008 02:12 AM


All times are GMT -5. The time now is 04:20 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration