Multiple directories containing index.html. How can I change that?

Melody Scott
Melody Scott used Ask the Experts™
on
Hi, My SEO team is having me create directories for certain keywords, like /affordable-meal-delivery/, so that the URL is mywebpage.com/affordable-meal-delivery/

The only way I know to do this is to create the directory and then have an index.html inside the directory. But I don't like having so many pages called index.html, for one thing I am afraid of overwriting one to another.

This site is able to do it without an index.html: www.freshnlean.com/gluten-free-meal-delivery/  - if I add index.html to that, it goes to a page not found.

We are on an Apache server. So it looks to me like this:



But I have ten or so of those directories with an index.html in each. How can I do this without the index.html. Ideally, I would want the page inside the directory to be affordable-meal-delivery.html. Can I use an htaccess file to do this?

Thanks.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Most Valuable Expert 2017
Distinguished Expert 2018

Commented:
What do you want to display on those pages?

The usual practice is to use URL rewriting (.htaccess) to the tell Apache where it must get the actual content from (rather than the physical path) but to answer this I would like to know what is it that you want to show when those URL's are requested?

Author

Commented:
Here's an example. The page is an index.html. https://www dot magickitchen.com/diabetic-meal-delivery/

obviously replace dot with ., I just don't want to leave a link here. Thanks.
Most Valuable Expert 2017
Distinguished Expert 2018

Commented:
I just don't want to leave a link here. Thanks.
If you don't want the question to be spidered by search engines you can make it a private question.

I am trying to understand what you would like to do instead?

The content has to come from somewhere - if not a page then a database / framework of some kind?

What is the ideal structure you would like for this?
Python 3 Fundamentals

This course will teach participants about installing and configuring Python, syntax, importing, statements, types, strings, booleans, files, lists, tuples, comprehensions, functions, and classes.

Author

Commented:
I would like the structure to be /affordable-meal-delivery/affordable-meal-delivery.html, but have the url be magickitchen.com/affordable-meal-delivery/

Does that make sense? Directory affordable-meal-delivery  and file affordable-meal-delivery.html, but the url as is.
Most Valuable Expert 2017
Distinguished Expert 2018
Commented:
Then you would use a URL rewrite - you would rewrite the URL from the Virtual to the Actual in your .htaccess file.

Are you currently using a .htaccess?

Author

Commented:
I use one in the root, I assume this would be in the individual directories?
Top Expert 2016
Commented:
the link you provided gives you a 404 on index.html since they use index.php

Author

Commented:
Thanks, everyone.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial