I wanted to redirect all non .html links to html links, such as domain.com/hey to domain.com/hey.html so I used the following rules
RewriteCond %{REQUEST_URI} !^\.html$
RewriteRule ^([a-zA-Z\+]+)$ $1\.html [R=301,L,NE]
However the redirect happens like this:
http://domain.com/what+there -> http://domain.com/home/user/public_html/what+there.html
Why is this?
looks like you are using your
RewriteRulein a per-directory context (.htaccessor<Directory>). in this case,to avoid this, use
RewriteBase, like so:also note the other additional complexity items for per-directory rewrites.