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
Solved

URL masking using mod_rewrite

Posted on 2011-03-25
2
257 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
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

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

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…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

829 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