LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
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 09-19-2015, 09:17 PM   #1
luofeiyu
Member
 
Registered: Aug 2015
Posts: 237

Rep: Reputation: Disabled
How to write the rewrite rule in /etc/apache2/apache2.conf?


To make http://127.0.0.1/wp jump to http://127.0.0.1:8080/wp ,
and 127.0.0.1/wp jump to 127.0.0.1:8080/wp ,
how to write the rewrite rule in /etc/apache2/apache2.conf?
 
Old 09-20-2015, 08:11 AM   #2
bathory
LQ Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 13,163
Blog Entries: 1

Rep: Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032Reputation: 2032
Quote:
Originally Posted by luofeiyu View Post
To make http://127.0.0.1/wp jump to http://127.0.0.1:8080/wp ,
and 127.0.0.1/wp jump to 127.0.0.1:8080/wp ,
how to write the rewrite rule in /etc/apache2/apache2.conf?
You can use the following generic rewrite:
Code:
RewriteEngine on

RewriteCond %{SERVER_PORT} ^80$
RewriteRule .*  http://localhost:8080%{REQUEST_URI} [R,L]
But IMO it's better to use apache as a reverse proxy for the backend server running on port 8080
 
1 members found this post helpful.
  


Reply



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
[SOLVED] Default apache2 /sites-available/000-default and apache2.conf nobuntu Linux - Server 3 02-06-2013 11:05 AM
apache2 rewrite rule help razzera Linux - Server 7 08-17-2010 04:39 PM
Rewrite rule in ssl.conf uks Linux - Software 0 02-10-2009 08:35 AM
rewrite rule base url apache2 sinister1 Linux - Software 3 11-23-2007 10:17 AM
Apache2 rewrite http to https gabsik Linux - Networking 3 10-26-2006 12:18 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 07:30 PM.

Main Menu
Advertisement
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
Open Source Consulting | Domain Registration