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
169 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

Easy, flexible multimedia distribution & control

Coming soon!  Ideal for large-scale A/V applications, ATEN's VM3200 Modular Matrix Switch is an all-in-one solution that simplifies video wall integration. Easily customize display layouts to see what you want, how you want it in 4k.

Question has a verified solution.

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

If you are running a LAMP infrastructure, this little code snippet is very helpful if you are serving lots of HTML, JavaScript and CSS-related information. The mod_deflate module, which is part of the Apache 2.2 application, provides the DEFLATE…
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…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

860 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