Streaming live at 10am (PST)

Same name for page and folder when exporting

Hi there,

I’ve exported code.

There is site.com/services.html page in main root and the page leads to 6 subpages. These pages are in folder named Services - site.com/services/page-1 etc.

I hide .html extensions via htaccess and have a issue:
When I go to site.com/services I want to open services.html, but instead of this a folder tree site.com/services/ opens with trailing slash

I know one way only - rename services.html and put it in Services folder.
This will be good for SEO? Nothing problems?

Is there another option via htaccess?

Hi
Why won’t you rename the folder name?

Hey,

I thought about it. In my opinion, It will be no logical url-path:

/services
/serice/page-1

and when user will go to /service what should he get?

A 404 error. How would the user “Go There”? You could always add a redirect to /services

Just curious, why do you want to remove the extension from the file name? What benefit do you think you are getting?

Directly, for instance site.com/service
Cause it is unnecessary information and extra letters for user

I have same problem ! Still dont know how to figured it out… if you look at almost every page there is
www.domain.com/work/work1.

So why it is so hard to find answer… almost every site had to do this…

Any advice ?

I’ve put a page in folder with the same name and renamed the page to index.html

To remove trailing slash:
Right below the RewriteEngine On line, add:

RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/$ / $1 [L,R]

To remove index in main root:
RewriteRule ^index.html$ / [QSA,R]

To remove index in subcategories:

RewriteCond %{THE_REQUEST} /index
RewriteRule ^(.*)/index /$1 [R=301,L]

On Apache web servers that works fine. Afterwards you can just change / update your links to point to the folder and the index will load.