Solved

URL masking using mod_rewrite

Posted on 2011-03-25
2
258 Views
Last Modified: 2012-06-27
I am trying to redirect one URL to another, except that I want the original URL to remain in the browser address window.

Entered URL:  http://www.website.com/news/2011/03/24/energy-saving-beyond-the-earth-hour/19639

Destination URL:  http://www.website.com/news_detail.php?pr_id=19639

(The number following the final slash in the entered URL matches the ID in the destination URL)

What I have below is redirecting properly, but the destination URL is showing up instead of being masked as what was originally entered.  How can I fix this so that the URL that was entered remains in the address window?

Options +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteRule ^news/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)$ http://www.website.com/news_detail.php?pr_id=$5  [NC,L]
0
Comment
Question by:aguawebdesign
[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 Comments
 
LVL 50

Accepted Solution

by:
Steve Bink earned 500 total points
ID: 35222345
Remove the "http://www.website.com" from the beginning of the redirection target:

Options +FollowSymLinks
RewriteEngine On
RewriteBase /
RewriteRule ^news/([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+)$ /news_detail.php?pr_id=$5  [NC,L]

Open in new window

0
 

Author Comment

by:aguawebdesign
ID: 35237373
Too easy!  Worked perfectly.  Thanks, routinet.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Hi, in this article I'm going to teach you how to run your own site, and how to let people in (without IP). I'll talk about and explain each step... :) By the way, everything in this Tutorial is completely free and legal. This article is for …
If your site has a few sections that need to be secure when data is transmitted between the server and local computer, such as a /order/ section for ordering or /customer/ which contains customer data, etc it would of course be recommended to secure…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

740 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