.htaccess - Redirect with htaccess should not access some pages -


i have 3 pages:

  • index.html
  • about.html
  • contact.html

i need create htaccess redirects home (index.html) if visitor not go 1 of 3 pages.

example:

if go page: asdf.html redirected index.html

but if income contact.html shows me page.

¿how can do?

thank you.

enable mod_rewrite , .htaccess through httpd.conf , put code in document_root/.htaccess file:

options +followsymlinks -multiviews # turn mod_rewrite on rewriteengine on rewritebase /  rewritecond %{request_uri} !^/(index|about|contact)\.html [nc] rewriterule ^(?!.+?\.(?:jpe?g|gif|bmp|png|css|js)$).*$ /index.html [l,r,nc] 

Comments

Popular posts from this blog

c# - How Configure Devart dotConnect for SQLite Code First? -

java - Copying object fields -

c++ - Clear the memory after returning a vector in a function -