Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back > Forums > Linux Forums > Linux - Server
User Name
Linux - Server This forum is for the discussion of Linux Software used in a server related context.


  Search this Thread
Old 05-18-2009, 04:39 PM   #1
Registered: Dec 2008
Location: Germany/Poland
Distribution: CentOS / Debian / Solaris / RedHat
Posts: 262

Rep: Reputation: 18
Lightbulb Apache 1.3 mod_rewrite - how to rewrite url with port

Hello everyone,

is it possible to rewrite this URL: > (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


Old 05-19-2009, 11:34 AM   #2
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:

        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:

- Arch


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
apache rewrite port based on URL.. can it? sir-lancealot Linux - Server 1 05-13-2009 03:06 AM
apache url rewrite about Canonical URLs addbbe Linux - Server 9 02-12-2009 06:21 AM
Apache rewrite rule help - dynamic url to static page DukeLeto Linux - Software 3 11-12-2008 12:26 PM
apache url rewrite gallew Linux - Server 0 08-25-2006 04:54 AM
Use apache to rewrite to external server and keep same browser URL ijsman77 Linux - Software 1 04-09-2004 08:32 AM

All times are GMT -5. The time now is 02:15 PM.

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