0

I'm getting infinite redirects with AliasMatch /hira/.*[^/] "/var/www/html/hira"

If anyone knows why that would be great.

A. L
  • 11,695
  • 23
  • 85
  • 163

1 Answers1

0

What is the DocumentRoot set as? If DocumentRoot is set as /var/www/html, the default for many distributions, why are you using any Alias directive for /hira?

Apache Alias Documentation

larvarunt
  • 16
  • 3
  • `Alias /hira/search "/var/www/html/hira"` works, so I though I'd follow the same format but with AliasMatch. It just keeps going `/index.html/index.html/*` – A. L Dec 13 '16 at 04:30
  • 1
    In that case, looks like there is a variable missing at the end of the file system path, e.g. `AliasMatch "^/hira/(.*)$" "/var/www/html/hira/$1"` – larvarunt Dec 13 '16 at 04:35
  • See [apache AliasMatch](https://httpd.apache.org/docs/current/mod/mod_alias.html#aliasmatch) – larvarunt Dec 13 '16 at 04:36
  • but wouldn't `"/var/www/html/hira/$1"` match whatever `(.*)` got? I want anything after `/hira` to redirect to `/hira` only – A. L Dec 13 '16 at 04:40
  • 1
    It would, I think what you want is a `Rewrite` such as [this](http://stackoverflow.com/questions/12735720/how-to-mod-rewrite-all-requests-to-single-file-without-causing-an-infinite-loop) e.g. `RewriteCond %{REQUEST_URI} !^/hira` `RewriteRule .* /hira [R=Permanent,L]` – larvarunt Dec 13 '16 at 04:43