Page 1 of 1
access page without .html extension?
Posted: Mon Aug 22, 2022 10:52 am
by Tommaso
Goodmorning!
i've already checked the 'must read' pages and tried to search in the forum/google, but i'm struggling to find any suggestion..
The question is: how can i make it so people can access to "martel.it/Assunzioni" INASTEAD OF "
www.martel.it/Assunzioni.html" ?
so, basically, how can i made it optional to include the 'www' and '.html' on pages links?
i have no clue if its something i have to fix on the web builder or if its on the Hosting side (maybe both?)
few more example just to better explain myself
good site:
https://anesabirra.it/
https://anesabirra.it/negozio/
my site with problems:
https://www.martel.it/
https://www.martel.it/Assunzioni.html
https://www.martel.it/Download.html
Thanks in advance for any type of help!
Re: access page without .html extension?
Posted: Mon Aug 22, 2022 11:08 am
by Pablo
You will need to configure this on the server in .htaccess
Re: access page without .html extension?
Posted: Mon Aug 22, 2022 12:34 pm
by Tommaso
Thanks, i will contact my Host provider!
Re: access page without .html extension?
Posted: Wed Aug 24, 2022 8:30 am
by Tommaso
Goodmorning again mr Pablo
i've contacted my host, they made a modification but now the website doesnt works propely
could you please take a quick look and tell me if you think its a problem with the links from the web editor or if it still a problem from the host?
they said they modified the .htaccess file as following:
RewriteEngine on
RewriteCond %{THE_REQUEST} /([^.]+)\.html [NC]
RewriteRule ^ /%1 [NC,L,R]
RewriteCond %{REQUEST_FILENAME}.html -f
RewriteRule ^ %{REQUEST_URI}.html [NC,L]
from here:
https://www.martel.it/Home
using the menu on the header, you can see that links to pages works 'random'
'Home', 'Contatti' and ' Download' works fine, but still send you to .html address
'Assunzioni' works fine, no .html extension in the address
the others buttons give a weird error (its like the like goes to the .html page wich for some reason doesnt works, but if in the address i remove the extension it works fine)
Thanks in advance for any kind help!
Re: access page without .html extension?
Posted: Wed Aug 24, 2022 9:11 am
by Pablo
I'm sorry, I cannot help you with the configuration the server.
If you want to remove the page extensions from links in the page then you can configure this in Tools -> Options -> Publish -> Hide file extension in links.
Re: access page without .html extension?
Posted: Wed Aug 24, 2022 9:12 am
by Tommaso
i'll try to remove links , but yeah the problem is on the server side
i'll contact the host, thank anyway!
Re: access page without .html extension?
Posted: Sun Sep 04, 2022 10:57 am
by wwonderfull
Many asked the same question in some other threads I hope you can find the answers in those threads but yes you have to enable the advanced option to Hide file extension in links. Along with that you have to configure the .htaccess to remove the extensions also.
You have to do both and one thing to remember it is written in the help documentation that it may have some problem using some wwb extensions also. Read the help to know more about it just click on the help button on Tools -> Options -> Publish -> Hide file extension in links.
Re: access page without .html extension?
Posted: Sun Sep 04, 2022 9:41 pm
by alan_sh
Just curious - why do you care about removing extensions?
Re: access page without .html extension?
Posted: Mon Sep 05, 2022 5:33 am
by wwonderfull
one more thing is that if this is removed then login php pages get problems. I had a some database page with the crud extension and single page protect. It always required .php extension removing it from the page got the 404. Every other page works only the login protect page required it.
Re: access page without .html extension?
Posted: Mon Sep 12, 2022 1:49 pm
by Tommaso
sorry guys, i've seen only now that there was a follow up!
first of all, you can test by yourself but now its working fine ( martel.it/EN/Products )
alan_sh wrote: Sun Sep 04, 2022 9:41 pm
why do you care about removing extensions?
Because its much simpler to google "martel.it/Home" instead of typing "
www.martel.it/Home.html"
plus, because of the aesthetic! imo it looks much better this way when u look at the url
wwonderfull wrote: Mon Sep 05, 2022 5:33 am
if this is removed then login php pages get problems.
tbh i'm clueless abut this topic, what i know is that we do not plan to have a "user section", but i will keep this info in mind for the future years!
Re: access page without .html extension?
Posted: Mon Sep 12, 2022 2:07 pm
by alan_sh
I just checked and my browsers (Vivaldi and Firefox) added ".html" as I was typing. So, you would need to explicitly take it off if you didn't have it.
Alan
Re: access page without .html extension?
Posted: Tue Sep 13, 2022 8:19 am
by Tommaso
mmmh, very strange, on both Firefox and Chrome, if i google "martel.it" and access the site from the google search, it wont display the .html
same if i type in the url "martel.it/Home"
