Mobile app version of vmapp.org
Login or Join
Goswami781

: Apache2 redirect all sub-directories to index.html of main directory? I want to put an .htaccess file in a directory of my website. For this purpose in: www.mysite.com/dir/ Then I want anything

@Goswami781

Posted in: #Apache2 #Htaccess #Proxy #Redirects #Ubuntu

I want to put an .htaccess file in a directory of my website. For this purpose in:
mysite.com/dir/

Then I want anything after /dir/ to direct to /dir/index.html but still display the original URL in the browser.
So for example:
mysite.com/dir/foo/bar -> mysite/dir/index.html

So in essence I want the browser to go to index.html but display the original URL
Could this be done with a reverse proxy?

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Goswami781

1 Comments

Sorted by latest first Latest Oldest Best

 

@Frith620

Sam's second comment was pretty close. This should work:

RewriteRule ^dir/(.*) dir/index.html [NC,L]

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme