Displaying DirectoryIndex in url with Apache

Is there a way to show the DirectoryIndex file in the default URL? For example, if DirectoryIndex is index.html, when I typed www.someurl.com it will automatically display www.someurl.com/index.html

0


a source to share


1 answer


I don't think it is possible to start Apache to do this automatically.

But if you know the index document, you can use mod_rewrite to redirect requests like this:



RewriteEngine on
RewriteRule ^/$ /index.html [L,R=301]

      

+1


a source







All Articles