apache - Why is modrewrite using my site's full path? -


Html wanted to redirect the link to the html link, such as domain.com/hey domain.com/hey. Html I used the following rules

  rewrite% {REQUEST_URI}! ^ \. Html $ RewriteRule ^ ([a-zA-Z \ +] +) $$ 1 \ .html [R = 301, L, NE]   

Although the redirect happens in this way:

- & gt;

Why is that so?

It looks like you have your RewriteRule per-directory reference (< Code> .htaccess or & lt; directory & gt; ). ,

[...] Per-directory prefixes (in your case / home / user / public_html ) automatically RewriteRule pattern matching and Automatically added after a relative (not starting with a slash or protocol name), the replacement is found at the end of a rule set.

Comments