View Single Post

  #2 (permalink)  
Old 03-09-2008
HansH
 
Posts: n/a
Default Re: Removing port-# from url

"Martin Stender" <stenderdk@gmail.com> schreef in bericht
news:6401f842-3f42-449f-b808-1bc75cd3fda7@b1g2000hsg.googlegroups.com...
> First, the problem:
> We are doing a site that's running on Oracle 10.1.2.0 ...

Assuming the application server, being apache with a tweaked config.

> ... and for some odd
> reason, relative links on that site, always adds the server port (80)
> to the url. (More precisely, the port isn't added to the link itself,
> but after clicking a relative url, the resulting page suddenly has the
> port-number in it.)

That is clicking <a href="nextpage.html"> makes the address bar show
http:/site.domain.tld:80/path/of/referer/nextpage.html ??

> Anyway that wouldn't normally be a huge problem, but since we are
> using Google Maps, the Google Map api key no longer matches the url,
> and our poor users gets a javascript alert-box that states that the
> google map key isn't valid for that url.
> (It only happens on the Safari browser, btw, but still)

Cannot reproduce this using SafariForWindows 3.04 (523.25).

Is the :80 added *only* for your site on OracleAS ??

> I'm struggling with mod_rewrite to find a way to remove that port-
> number from the url.
> How can I rewrite mysite.com:80/yadda/ to mysite.com/yadda/?

Try
rewritecond %{REQUEST_URI} :80/
rewriterule (/yadda.*) http://%{HTTP_HOST}/$1 [QSA,L]

Combined with the true cause it may result in an endless loop of redirects
....
Rather scrub OracleAS config for any :80 following some Proxy* directive.

HansH