Solved

URL masking using mod_rewrite

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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

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 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…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…

863 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

25 Experts available now in Live!

Get 1:1 Help Now