There has to be a way to redirect everything to one page, right? [duplicate]
I have a site and I want to redirect everything to /index.html.
I'm replacing an old site so some visitors may try to access dead urls. How can I do this through .htaccess?
Also, is there a way to rewrite the url in the process so they just see http://www.e开发者_JAVA百科xample.com and not whatever they originally tried to access?
Thanks, Howie
This should do the job:
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule .* index.html
the index.html shall stay in the same directory of the htacess
- Open IIS.
- Select your website in left pane.
- In IIS 7 choose option
Default documents
in middle box and add your required index page. In IIS 3 right click on website in left pane and choose properties>home directory> then add your index page name and bring it to top (Top for priority). - In the same page you have option to redirect your URL to another URL
精彩评论