Index clean
Auteur : Petr C.
Visité 2102,
Followers 1,
Partagé 0
Hello, I need advice. my www address http://hlubinna-regresni-terapie.cz is okay but when I browse the web to the "o regresi" title page at the top left of my www menu changes to http://hlubinna-regresni-terapie.cz /index.html
I tried to rename or turn off the "index" after the slash but I can't. How do I remove the index suffix to make the cover page clean without the index? This also applies to the bookmark in the "blog" menu by removing the index word to make the web clean?
Thank you very much for your advice
Posté le
Hello Petr,
You can't hide the 'index.html' portion of the URLs you refer to without resorting to rewrites using an .htaccess file on the server. This is not the fault of WebSite X5, but rather just the way that the web works.
When you navigate to http://hlubinna-regresni-terapie.cz/ your browser is actually showing http://hlubinna-regresni-terapie.cz/index.html, which are one and the same as you know (because your DirectoryIndex on the server is currently set to serve index.html from the root folder).
If you want to 'beautify' the URL in the address bar then you can put the following in an .htaccess file in the root directory of your WebSite X5 project on the server:
RewriteEngine On
RewriteRule ^index\.html$ / [R=301,L]
RewriteRule ^(.*)/index\.html$ /$1/ [R=301,L]
The above code should also remove the suffix from the blog URL too, as per your request.
Kind regards,
Paul
Search the WebSite X5 Help Center
Hello Petr
When you specify http://hlubinna-regresni-terapie.cz/ you actually specify a folder.
The system( server ) automatically looks for a file to show for that folder. It looks for a file named index.html
When you navigate on the site, the navigation goes between the pages on the site. the home-page ( index.html ) is also a file on the site. When a page is shown afterwards, then the page name is shown in the browser.
If you go from another page on your site to the home page, the system directs NOT to the folder but to the page that is the home page.
You can construct a URL that directs directly to a page on your site, but then you have to specify the full url and not only the path to a folder. The home page is special as it is assumed by the system.
If you want to refer to your site with a "clean" url, then you can do this as the index.html is used automatic.
Hello again
Paul was apparently quicker than I. What he tells is correct, but unless you are familiar with the .htaccess I will advice not to "play" with it. The .htaccess is very powerful but you should really know what you are doing if you make something there. It could have unwanted effects.
Auteur
Thank you very much for your advice. Very helpful :))