regex - Remove .html from URL and rewrite requests to index.html -
i'm not experienced .htaccess
related stuff, looking help. i'm trying this:
any request looks (example):
/foo.html
would rewrote to:
/foo
and request static file, i'd serve:
/index.html
does make sense? idea how this?
example
here's have far, though it's not correct far know:
rewriterule %{request_filename} !-d rewriterule %{request_filename} -f rewritecond ^(.*)$ $1.html [nc,l] rewritecond %{request_filename} -s [or] rewritecond %{request_filename} -l [or] rewritecond %{request_filename} -d rewriterule ^.*$ - [nc,l] rewriterule ^(.*) /index.html [nc,l]
check existence of .html
file before adding uris:
rewritecond %{request_filename} -f [or] rewritecond %{request_filename} -d rewriterule ^ - [l] rewritecond %{request_filename}.html -f [nc] rewriterule ^(.*)$ $1.html [l] rewriterule . /index.html [l]
Comments
Post a Comment