Advice on URL names - Q from SEO course

In the RW SEO course, I found that file names are always index.php or .html.
Is it a must to have all files in the folders named index.*** ?
My website structure has folders and subfolders, but every file is named specifically, product.html
What is right?

1 Like

All your files “should” be named index.*, regardless of the extension. It is not a “must”.

The web server will serve first index.html if available, if not, index.php. That’s also a common thing when introducing stacks on a Stack plugin page requiring PHP. The filename will change from .html to .php

Having checked the “tidy” website link structure will help you with this.

Cheers, Jannis
inStacks Software

It just impacts how your URL is displayed. So, I saw a link in your post history to your site. If you take a page like this one here:
If you changed your page to index.html and enabled tidy links, then that URL would become: in your browser (and when you share it with others). So it just looks a little tidier.

Given that you have descriptive folder names, I don’t think there’d be an advantage to having descriptive page names as well, though I’m very far from an SEO expert

1 Like

Thank for helping.
I’m in the middle of the process of re-working the URLs and file names.
In a day or two everything should be looking better.
Again, thanks for helping.

If the site has been live for any length of time, look into adding page redirects from the old page names to the new ones. This helps keep your page rankings with Google and makes it easier if any sites linked to your pages or anyone bookmarked them. This is typically done in the .htaccess file.

Hi Don,
How do I add page redirects from old page names to new ones?
I was tempted to delete the old pages on my FTP.
Thanks for helping.
Best Regards

That is done in your .htaccess file. Your Cpanel probably has a way for you to easily add redirects that it will then write to the .htaccess file for you.

Here’s a website with good info on redirect statements in .htaccess.

Once you setup a rule to redirect each old page to the new page, you can then delete the old page via FTP.

Thank you very much for the help, Don. This brought me really forward.

My .htaccess file now includes all redirects to the new structure on FTP.
Before I have reworked my entire website and changed all links to the new correct place:
How about the many links on my pages? If a link with the old folder/file name is clicked, will the user also be redirected by the new .htaccess file to the new location?

If I understand what you’re asking, these links are on your pages? change them to the new location. Most internally generated links use relative links(not the complete address) so a 301 redirect will not work.

I would change every URL you have control to change to the new location. Htaccess redirects should really only be thought of as a way to fix links you can’t fix yourself. Pages reference in external blogs, bookmarks and the like.

1 Like

Thanks much! Really appreciated.

Ok, changed all old folder/filenames to folder/index.html (php).
Some pages appear in Safari already with /folder/ (without index.html), some not.
Is there a certain lead time until when all pages appear without index.* ?

For website internal links, do I have to include /…/index.* in the link, or is the folder sufficient?

How long does it take until when the redirects in .htaccess become effective?

Try emptying the browser cache. (opt+cmd+E).

Does not work. There is still /…/index.html in Safari.

Would need a URL with an example of what you are talking about.

Asking in generic terms makes it difficult to figure out what exactly is going on.

I emptied cache this morning, but there were still pages with …/index.html
Now, a couple of hours later, no page has an URL with …/index.html anymore.
Seems all ok. Strange.

Redirecting with .htaccess does not seem to work.
The new .htaccess file with all redirects is on my FTP since yesterday, but no redirect occurs to new locations.
Is there a lead time until this works and Google has read the .htaccess ?

.htaccess file redirects should happen real-time.
If you’re not getting redirected to the new URL’s then chances are you have a syntax error, you have the file named incorrectly, you have the file in the wrong location on the server or the host company doesn’t support or allow .htaccess files.
You can test your rewrite rules here:

The tester showed that almost no redirect was executed.
So, first of all, thank you for the tester link.

I’m confused about the syntax too.

One guideline says, a redirect should looks as such:
Redirect 301 “/solutions/embedded-solutions.html” “/embedded-project-tools/index.html”

another guideline says:
Redirect 301 ^/solutions/embedded-solutions.html$ /embedded-project-tools/index.html

None of both work.
What am I doing wrong?

This does not work as well:
Redirect 301 ^/solutions/embedded-solutions.html$ /embedded-project-tools/index.html