Home Having nested subfolders use their own unique index.html within a site via .htaccess
Reply: 0

Having nested subfolders use their own unique index.html within a site via .htaccess

ekfuhrmann
1#
ekfuhrmann Published in 2018-01-11 21:56:39Z

Lets say I have the following folder structure:

example.com
    |-- index.html
    `-- blog (subfolder)
        |-- index.html
        |-- page.html
        `-- about (sub subfolder)
            `-- index.html

I want the .htaccess to redirect anyone going to example.com/blog to its index.html file, but the URL to remain example.com/blog.

I think the process would work something like this:

  • User goes to example.com
  • User clicks on a link to example.com/blog and is redirected to example.com/blog/index.html
  • URL is then changed back to example.com/blog

Further, I also want to be able to have it so that if I go to example.com/blog/about it works like the blog subdirectory before it.

I may well be building my folder structure wrong for something like this, so any suggestions or thoughts would be greatly appreciated!

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.335475 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO