I have the following rewrite rule:
RewriteRule ^support/(.*)$ /blog/support/$1 [R=301,NC,L]
However, all it does is a simple redirect. What I want to is for /support
to show the contents of /blog/support
without changing the URL from /support
. How can I do this?
In addition, the above only works when /support
has a trailing slash.
If
/blog/support
corresponds to a location in the file system, say/var/www/blog/support
, then you can just useThe documentation for the Alias directive says that the second argument has to be a file or directory path though, not another URL.
If you want an internal redirect only, so the user doesn't see the URL change, then probably all you need to do is remove
R=301,
from the flags in yourRewriteRule
.To keep from requiring the trailing /, test for either a slash or end-of-line: