Mod_rewrite

Hey Guys,

I just want to ponder an idea. How do you feel about the possibility of adding the functionality to generate a .htaccess file (or IIS equivalent). The reason I am thinking this is because you can then hide the extensions of the pages.

While I’m a big proponent of the .htaccess file, I can also see why it wouldn’t be all that high on the priority list. Since this won’t work on any type of Web Server (not on a default configured NGINX for example). As per Usage Statistics and Market Share of Web Servers, January 2023 you’ll see that NGINX has already overtaken Apache as the prime web server.

That said, while it could bring a bunch of cool extra’s to the table, it would also add a serious level of complexity to the support @norm and his team would need to give in case of issues.
And let’s face it, no 2 Apache configs are the same (except perhaps within the same hosting company).

But we do tend to share snippets here on the forum. Here’s one of mine: .htaccess tweaks for security and performance

4 Likes

I also think that this would become rather complex, everyone uses different hosts, different servers and server settings, that would make the whole thing quite difficult if problems occur.

2 Likes

Hey Guys,

Many thanks for you comments and I quite understand and agree with them. However I would be nice to hide the file extensions, as most sites these days do this and it would make for cleaner URLs.

John

You can do this by setting this line in your .htaccess:

RewriteRule ^([^\.]+)$ $1.html [NC,L]

Or this in case you use .htm as your extension:

RewriteRule ^([^\.]+)$ $1.htm [NC,L]
1 Like

Is there any reason why you cannot use the clean url option in the export settings?

Screenshot 2022-11-17 at 11.15.24

1 Like

Oh, I did not understand what this did. Thank you very much.