Solved

rewrite rule inc port

Posted on 2008-11-03
4
147 Views
Last Modified: 2010-03-04
I need a rewrite rule that will rewrite the url to do the following:

if url http://domain.com:81/anything rewrite to http://domain.com:81/app/con/index.jsp

Also i dont really want to specify the domain/cname in the rule
0
Comment
Question by:willa666
  • 2
4 Comments
 
LVL 43

Expert Comment

by:ravenpl
ID: 22869387
Into the .htaccess file

RewriteEngine On
RewriteCond %{SERVER_PORT} =81
RewriteRule ^anything.* http://domain.com:81/app/con/index.jsp [R=301,L]
0
 
LVL 1

Author Comment

by:willa666
ID: 22871702
Hi ravenpl

Is there a way of not specifing the "http://domain.com:81?

Ww
0
 
LVL 43

Expert Comment

by:ravenpl
ID: 22871787
No, If You want other than the default port 80, You have to specify it.
0
 
LVL 27

Accepted Solution

by:
caterham_www earned 500 total points
ID: 22878542
At least my version is able to build a correct self-referencing URI with the correct port:
RewriteEngine On

RewriteCond %{SERVER_PORT} =81

RewriteRule ^anything /app/con/index.jsp [R=301,L]

Open in new window

0

Featured Post

Backup Your Microsoft Windows Server®

Backup all your Microsoft Windows Server – on-premises, in remote locations, in private and hybrid clouds. Your entire Windows Server will be backed up in one easy step with patented, block-level disk imaging. We achieve RTOs (recovery time objectives) as low as 15 seconds.

Join & Write a Comment

As Wikipedia explains 'robots.txt' as -- the robot exclusion standard, also known as the Robots Exclusion Protocol or robots.txt protocol, is a convention to prevent cooperating web spiders and other web robots from accessing all or part of a websit…
Introduction As you’re probably aware the HTTP protocol offers basic / weak authentication, which in combination with the relevant configuration on your web server, provides the ability to password protect all or part of your host.  If you were not…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
When you create an app prototype with Adobe XD, you can insert system screens -- sharing or Control Center, for example -- with just a few clicks. This video shows you how. You can take the full course on Experts Exchange at http://bit.ly/XDcourse.

758 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now