LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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
 
LinkBack Search this Thread
Old 05-18-2009, 03:39 PM   #1
dlugasx
Member
 
Registered: Dec 2008
Location: Germany/Poland
Distribution: CentOS / Debian / Solaris / RedHat
Posts: 236

Rep: Reputation: 18
Lightbulb 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
 
Old 05-19-2009, 10:34 AM   #2
archangel_617b
Member
 
Registered: Sep 2003
Location: GMT -08:00
Distribution: Ubuntu, RHEL/CentOS, Fedora
Posts: 234

Rep: Reputation: 42
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
 
  


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
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
apache rewrite port based on URL.. can it? sir-lancealot Linux - Server 1 05-13-2009 02:06 AM
apache url rewrite about Canonical URLs addbbe Linux - Server 9 02-12-2009 05:21 AM
Apache rewrite rule help - dynamic url to static page DukeLeto Linux - Software 3 11-12-2008 11:26 AM
apache url rewrite gallew Linux - Server 0 08-25-2006 03:54 AM
Use apache to rewrite to external server and keep same browser URL ijsman77 Linux - Software 1 04-09-2004 07:32 AM


All times are GMT -5. The time now is 04:00 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