Solved

URL masking using mod_rewrite

Posted on 2011-03-25
2
253 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
Comment Utility
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
Comment Utility
Too easy!  Worked perfectly.  Thanks, routinet.
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Over the last year I have answered a couple of basic URL rewriting questions several times so I thought I might as well have a stab at: explaining the basics, providing a few useful links and consolidating some of the most common queries into a sing…
In Solr 4.0 it is possible to atomically (or partially) update individual fields in a document. This article will show the operations possible for atomic updating as well as setting up your Solr instance to be able to perform the actions. One major …
This video discusses moving either the default database or any database to a new volume.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

771 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now