LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (http://www.linuxquestions.org/questions/linux-server-73/)
-   -   Apache 1.3 mod_rewrite - how to rewrite url with port (http://www.linuxquestions.org/questions/linux-server-73/apache-1-3-mod_rewrite-how-to-rewrite-url-with-port-726862/)

dlugasx 05-18-2009 03:39 PM

Apache 1.3 mod_rewrite - how to rewrite url with port
 
Hello everyone,

is it possible to rewrite this URL:

http://www.maindomain.com:8080/login.jsp > http://www.maindomain.com/login.jsp (must work with port 80)

?

How can I create rule for that ? Where should I put it ?



would be great if somebody can help me :)




greetings

Dlugasx

archangel_617b 05-19-2009 10:34 AM

Anything is possible with mod_rewrite. Here's an example from my config on how to redirect to HTTPS:

Code:

        RewriteEngine  on
        RewriteCond    %{HTTPS} =off
        RewriteRule    (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=permanent,L]

You can find everything you need, e.g. how to check port numbers, in the documentation:

http://httpd.apache.org/docs/2.0/mod/mod_rewrite.html

- Arch


All times are GMT -5. The time now is 10:24 PM.