.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
Post a Comment