Solved

URL masking using mod_rewrite

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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
RewrteRule using htacess 10 89
LINUX CENTOS + APACHE 9 75
AWS EC2 HTTP & HTTPS 2 117
How to set up WAMP on a windows 8.1 IIS machine 14 46
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). #…
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…

734 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