access page without .html extension?

Issues related to previewing and publishing your web site.
Post Reply
Tommaso
 
 
Posts: 18
Joined: Wed Jun 20, 2018 2:09 pm

access page without .html extension?

Post 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!
User avatar
Pablo
 
Posts: 23574
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: access page without .html extension?

Post by Pablo »

You will need to configure this on the server in .htaccess
Tommaso
 
 
Posts: 18
Joined: Wed Jun 20, 2018 2:09 pm

Re: access page without .html extension?

Post by Tommaso »

Thanks, i will contact my Host provider!
Tommaso
 
 
Posts: 18
Joined: Wed Jun 20, 2018 2:09 pm

Re: access page without .html extension?

Post 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!
User avatar
Pablo
 
Posts: 23574
Joined: Sun Mar 28, 2004 12:00 pm
Location: Europe
Contact:

Re: access page without .html extension?

Post 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.
Tommaso
 
 
Posts: 18
Joined: Wed Jun 20, 2018 2:09 pm

Re: access page without .html extension?

Post by Tommaso »

i'll try to remove links , but yeah the problem is on the server side
i'll contact the host, thank anyway!
User avatar
wwonderfull
 
 
Posts: 1603
Joined: Fri Aug 21, 2020 8:27 am
Contact:

Re: access page without .html extension?

Post 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.
alan_sh
 
 
Posts: 1891
Joined: Tue Jan 01, 2019 5:50 pm

Re: access page without .html extension?

Post by alan_sh »

Just curious - why do you care about removing extensions?
User avatar
wwonderfull
 
 
Posts: 1603
Joined: Fri Aug 21, 2020 8:27 am
Contact:

Re: access page without .html extension?

Post 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.
Tommaso
 
 
Posts: 18
Joined: Wed Jun 20, 2018 2:09 pm

Re: access page without .html extension?

Post 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!
alan_sh
 
 
Posts: 1891
Joined: Tue Jan 01, 2019 5:50 pm

Re: access page without .html extension?

Post 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
Tommaso
 
 
Posts: 18
Joined: Wed Jun 20, 2018 2:09 pm

Re: access page without .html extension?

Post 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"

Image

Image
Post Reply