1

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.

Abs
  • 1,559
  • 5
  • 19
  • 32

1 Answers1

3

If /blog/support corresponds to a location in the file system, say /var/www/blog/support, then you can just use

Alias /support /var/www/blog/support

The 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 your RewriteRule.

To keep from requiring the trailing /, test for either a slash or end-of-line:

RewriteRule ^support(/.*|$) /blog/support$1 [NC,L]
Andrew Schulman
  • 8,811
  • 21
  • 32
  • 47
  • Ok that works, it looks like the issue is something else as I keep getting a 404. I will mark this as the correct answer and ask another related question. – Abs Dec 27 '13 at 14:57