I am for the first time trying to hide parts of the URL on my website.
I have successfully used RewriteEngine to hide the .html on 2 of my website pages.
On the homepage it does not show anything after the website domain/ upon navigating to the website but when you navigate back to it from one of the other website pages it shows the index.html after the “/” as well as the block on the page navigated to. See below:
My problem is that my menu links navigate to sections on the index page, for example the “About” link takes you to the second block down on the home page not to the top of the page. (This works fine and does not show any extension when the page is first loaded, but not when navigating back to the index page.) When I remove the .html and everything after it in the {page}.html files the links do not know what block to navigate to and go to the top of the page.
All of the links have index.html#xyz
If you don’t want to show index.html, simply change them to #xyz
In case you want nothing to display in the URL, no matter what you click, take a look at this: <a href="#features11-2v" onclick="return false">About</a>
This will not add anything to your URL after /
If you were asking something else, please be a bit more clear.
I am trying to hide in the url everything that you have underlined in red Niekon^
The first method you suggested I tried but removing the index.html means that it no longer knows which page to navigate to. Also this still shows everything after the hashtag.
I also tried the onclick you sugested but this stoped the links from doing anything.
I tried this OXYDAC and it looks great in the URL bar but the links do not go to the right sections of the page and all navigate to the top. The about link needs to still navigate to the “about” block on the homepage not the top of the page etc.
Any ideas how to hide the extension like this method but not loose the links functions?
If you try the about link now on the homepage you will see it doesnt take the user to the right section anymore?
I have deleted my cache and put this code on the html files.
If you go to http://tobylesauxsmith.co.uk/packages
and then try to click the about link at the top
it will navigate to the home page top
but should navigate to the second block down on the homepage
it seems that the hiding of the extension means it does not know which block to take the user to
do you see this issue?
Hmm this is odd, I have cleared my cache and tried 3 new browsers that the site is not loaded in and I have the same issue. It works from clicking “about” on the home page but from the “Packages” page and “portfolio” page clicking the “About” takes me to the top of the home page…
Thank you for your help, I am confused as to why this is not working for me.
Thank you for your help, im not an expert in HTML I am more of a designer but I do have some experience and have a good grasp of how these things work but with this i’m struggling.