Streaming live at 10am (PST)

URL without .html


#1

When I export a website, all the urls show “.html” in the browser address bar except for the homepage. How can I make them clean urls? The Webflow staging for the same website uses clean urls. Thanks for the help!


#2

Duplicate of

How to remove .html from URL?
remove html extension using htaccess file
.htaccess remove .html
remove .html with htaccess
Remove “.html” from URL via .htaccess
Adding clean URL Ecwid code to .htaccess file within web flow


#3

Ok thanks! Wasn’t sure if it’s something I need to do in Webflow before export or not. htaccess seems to be my answer. :grinning:


#4

Yeah, that is something Webflow does for you if you’re hosting with them, because it has to be done on the server-side.

If you want to apply this same effect on your own server, those links above is basically what you need to do.


#5

I tried adding to my .htaccess. I am already forcing https now.

Can’t get it to rewrite the html completely. It works on 2 of my 6 pages. Weird, you would think it would work on all or none. Any suggestions how to get his working?

Here is what I have in my .htaccess:

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^.]+)$ $1.html [NC,L]

RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]


#6

what’s the page URL that’s not redirecting correctly?


#8

Without html seems impossible to the media design but to my Desktops and Websites it was flexible.


#9

Ok hopefully this helps someone.

here is the solution for anyone looking how to get a clean URL with a .htaccess file:

Create a file with the info:

RewriteEngine On
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /.  <em>index\ HTTP/
RewriteRule ^(.</em>  )index$ [http://YOURWEBSITE.COM/$1](http://yourwebsite.com/%241) [L,R=301]

RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/]+)/$ [http://YOURWEBSITE.COM/$1](http://yourwebsite.com/%241) [L,R=301]

RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /(.+).html\ HTTP/
RewriteRule ^(.+).html$ [http://YOURWEBSITE.COM/](http://yourwebsite.com/)1 [L,R=301] RewriteRule ^([\w-]+) /$1.html [L]

*replace YOURWEBSITE.COM with the url of your website all lowercase.

Place the .htaccess file in the folder with the html for your website.


#10

dzięki za pomoc przydało m isię :slight_smile: