Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

rewrite rule inc port

Posted on 2008-11-03
4
Medium Priority
?
157 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 2000 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

Prepare for your VMware VCP6-DCV exam.

Josh Coen and Jason Langer have prepared the latest edition of VCP study guide. Both authors have been working in the IT field for more than a decade, and both hold VMware certifications. This 163-page guide covers all 10 of the exam blueprint sections.

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 are a web developer, you would be aware of the <iframe> tag in HTML. The <iframe> stands for inline frame and is used to embed another document within the current HTML document. The embedded document could be even another website.
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
Suggested Courses
Course of the Month12 days, 20 hours left to enroll

971 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