-1

I'm quite new to hosting a website, so bear with me.

I get that I can remove file extensions with the rewrite module. However, the ones that I've found requires me to also remove the extension in my HTML links. The problem is that it makes it impossible to test locally, unless I install apache on my own machine and copy the settings. But then I have to copy settings every time I want to change them, which isn't really something I want to do.

So is there any way to hide the file extensions without removing them in the actual links in HTML?

  • 1
    If you remove the extensions, you will absolutely want to remove the extension from all links. Otherwise you will get a redirect on every click which is bad for SEO and slower for users. I recommend installing Apache on your staging server or local machine where you can test things before they go live anyway. – Stephen Ostermiller Jan 20 at 11:54
  • Your best option here is really to install a local web server, like Stephen mentioned. I see no way you could make extensionless work locally without a local web server. – Maximillian Laumeister Jan 20 at 18:03
  • "But then I have to copy settings every time I want to change them" - What "settings"? – MrWhite Jan 20 at 18:20
1

So is there any way to hide the file extensions without removing them in the actual links in HTML?

No. If you don't remove "them in the actual links in HTML" then you aren't actually removing them.

Ok, you can create a "redirect" to remove them, but as @Stephen has already pointed out in comments: "you will get a redirect on every click which is bad for SEO and slower for users". But crucially, you also need the Apache rewrite module in order to implement this "redirect" - so you are no closer.

To test locally, you need to install a web server locally.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.