Hello! This is my first time posting and I'm relatively inexperienced when it comes to fiddling around with Apache, so I was hoping someone here might be able to help guide me in the right direction.
What I believe I want to do is create a rewrite in .htaccess for my site so that when a user asks for URL A, the content is served from URL B, but the user still sees the URL as being URL A. That said, I know at least that what I
don't want is a redirect.
As an example, let's say I have content at
mydomain.com/projects/project-example
. I want users to be able to ask for
mydomain.com/project-example
, the browser should display the content from
mydomain.com/projects/project-example
, and the address in the URL should remain
mydomain.com/project-example
. I only want this to be done for any page that's prefaced with
/projects/
.
To provide a little background, my site is hosted on MediaTemple shared hosting and I'm using Wordpress for the CMS.
Here's what I've implemented in the .htaccess file in an attempt to achieve my desired results:
RewriteEngine On
RewriteRule ^project-example$ /projects/project-example [L]
After implementation, when asking for
mydomain.com/project-example
, I was effectively served the content from
mydomain.com/projects/project-example
, but unfortunately the URL still displays
mydomain.com/projects/project-example
, almost as if I'd just implemented a redirect. Is it possible Wordpress or something else is interferring, or have I gone about this the wrong way?
I've trawled through several mod_rewrite/mod_alias tutorials & FAQs, but am still having trouble wrapping my head around the issue. I'm really stumped.
If a rewrite isn't the correct solution, would a symbolic link applied only to
/projects/
be a better one? Is such a thing possible?
I'd love to hear any advice you can give. Thanks!