Search code examples
html.htaccesslocalhostcpanellocalserver

How to create and edit .htaccess and see changes locally on a computer


Hello Stackoverflow Community, I have built a website using HTML & CSS only, now it is live. Whenever I want to update it I just replace the files in File Manager in cPanel. Everything was perfect until I had to edit the .htaccess to remove the (.html) extensions from URLs. My problem is that href="about-us" without the .html don't work locally so I cant just replace the files in cPanel, now I have to remove .html from all links in all pages in File Manager. I have to do this every time I update the website. Is there a way around that? like a local server that can understand links like href="http://example.com" or href="about-us"? any suggestions? Thank you


Solution

  • Thanks to alex and Bogdan Stocia, I have used MAMP to run it locally and created .htaccess file to be able to view pages without .html extension and replaced <a> tag linking to my home page with href="/" instead of href="index".