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

Popular posts from this blog

c++ - Difference between pre and post decrement in recursive function argument -

php - Nothing but 'run(); ' when browsing to my local project, how do I fix this? -

php - How can I echo out this array? -