Solved

rewrite rule inc port

Posted on 2008-11-03
4
153 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Optimize your web performance

What's in the eBook?
- Full list of reasons for poor performance
- Ultimate measures to speed things up
- Primary web monitoring types
- KPIs you should be monitoring in order to increase your ROI

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

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…
If you've heard about htaccess and it sounds like it does what you want, but you're not sure how it works... well, you're in the right place. Read on. Some Basics #1. It's a file and its filename is .htaccess (yes, with a dot in the front). #…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…
Michael from AdRem Software explains how to view the most utilized and worst performing nodes in your network, by accessing the Top Charts view in NetCrunch network monitor (https://www.adremsoft.com/). Top Charts is a view in which you can set seve…

632 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