peterharichse
posted this
01 October 2024
Hello,
You can remove the .html extensions from the website links on websites hosted in Nicepage hosting.
To remove the .html extension from your website links on your hosting, you must configure your web server to use URL rewriting. This is a process where URLs that end with .html are rewritten to appear without the extension.
The specific steps to achieve this will depend on your web server. If you are using Apache, you can accomplish this by creating an .htaccess file in your website's root directory and adding the following code:
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.html -f
RewriteRule ^(.*)$ $1.html
This code will check if the requested URL corresponds to a directory or if the requested URL with the .html extension exists as a file. If both conditions are true, it will rewrite the URL to remove the .html extension.
After adding this code to your .htaccess file, you can access your website pages without the .html extension in the URL.
If you are hosting your website on web hosting services, contact them for assistance so they can help you.
...................................................
Sincerely,
Ahmad.
Nicepage Support Team
Please subscribe to our YouTube channel: http://youtube.com/nicepage?sub_confirmation=1
Follow us on Facebook: http://facebook.com/nicepageapp
Remember to add [NC,L] at the end of the rule for it to work regardless of upper or lower cases in the urls. The L is added incase you need to continue to create more rules in the .htaccess file.
With some hosting providers you then have to go into every single html document and remove the .html endings on every link for this solution to work. I had to do that but then it works fine. The problem is when you want to update the website you have to do it all over again. It takes a lot of time.
Please Nicepage fix this issue so that you don't have to create work arounds to use your otherwise great website builder. Export pages without .html extensions would be a great addition to your tool.
Full code:
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.html -f
RewriteRule ^(.*)$ $1.html [NC,L]
> Hello,
>
> You can remove the .html extensions from the website links on websites hosted in Nicepage hosting.
>
> To remove the .html extension from your website links on your hosting, you must configure your web server to use URL rewriting. This is a process where URLs that end with .html are rewritten to appear without the extension.
>
> The specific steps to achieve this will depend on your web server. If you are using Apache, you can accomplish this by creating an .htaccess file in your website's root directory and adding the following code:
>
>
>
> RewriteEngine on
> RewriteCond %{REQUEST_FILENAME} !-d
> RewriteCond %{REQUEST_FILENAME}\.html -f
> RewriteRule ^(.*)$ $1.html
>
> This code will check if the requested URL corresponds to a directory or if the requested URL with the .html extension exists as a file. If both conditions are true, it will rewrite the URL to remove the .html extension.
>
> After adding this code to your .htaccess file, you can access your website pages without the .html extension in the URL.
>
> If you are hosting your website on web hosting services, contact them for assistance so they can help you.
> ...................................................
> Sincerely,
> Ahmad.
> Nicepage Support Team
>
> Please subscribe to our YouTube channel: http://youtube.com/nicepage?sub_confirmation=1
> Follow us on Facebook: http://facebook.com/nicepageapp
Remember to add [NC,L] at the end of the rule for it to work regardless of upper or lower cases in the urls. The L is added incase you need to continue to create more rules in the .htaccess file.
With some hosting providers you then have to go into every single html document and remove the .html endings on every link for this solution to work. I had to do that but then it works fine. The problem is when you want to update the website you have to do it all over again. It takes a lot of time.
Please Nicepage fix this issue so that you don't have to create work arounds to use your otherwise great website builder. Export pages without .html extensions would be a great addition to your tool.
Full code:
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.html -f
RewriteRule ^(.*)$ $1.html [NC,L]
Last edited 01 October 2024 by peterharichse