Solved

Apache rewrite: How to rewrite the URL so that a page redirects but the URL stays the same?

Posted on 2006-10-25
2
166 Views
Last Modified: 2010-03-04
Right now I have an .htaccess file that redirects visitors to our site.

If you go here:

http://www.monkeyclaus.org/abelokugawa

then you get redirected to here:

http://www.monkeyclaus.org/media/audio/index.php?pageId=182

What I'd like is for the visitor to see what is on this page:

http://www.monkeyclaus.org/media/audio/index.php?pageId=182

And yet see this as their URL:

http://www.monkeyclaus.org/abelokugawa/

Is that possible?



0
Comment
Question by:lkrubner
2 Comments
 
LVL 10

Accepted Solution

by:
rivusglobal earned 300 total points
ID: 17807894
Hi lkrubner,


I think you could use Apache's mod_rewrite and add the following to your .htaccess file:

.htaccess:

Options FollowSymLinks
RewriteEngine On
RewriteBase /

RewriteCond %{REQUEST_URI} /abelokugawa
RewriteRule abelokugawa /media/audio/index.php?pageId=182
0
 

Author Comment

by:lkrubner
ID: 17815894
That seems to answer the question I asked, so I'll accept it.

All the image links are broken. Is that because I used relative links and the browser now thinks it is in a folder called abelokugawa?

http://www.monkeyclaus.org/abelokugawa
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

Suggested Solutions

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). #…
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 …
Video by: Mark
This lesson goes over how to construct ordered and unordered lists and how to create hyperlinks.
As a trusted technology advisor to your customers you are likely getting the daily question of, ‘should I put this in the cloud?’ As customer demands for cloud services increases, companies will see a shift from traditional buying patterns to new…

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

23 Experts available now in Live!

Get 1:1 Help Now