Hi guys, someone please help me with a problem, i search alot to google how to hide my ending of my url page and can't find nothing..

ex: www.url.com/file.html
what i want it's: www.url.com/file

how i can do this? please help me, ty.

Recommended Answers

All 11 Replies

You can do this via a URLRewrite. You will need some server side code to be able to do this. If you develop in PHP, you would leverage the use if your .htaccess file and add the necessary rules. Of for example, if you develop in asp.net, you would create the rules in your web.config file assuming your IIS server has the URLRewriteModule enabled.

You won't be able to do this via HTML alone.

got it, but it's bad on something to show my ending of my url? seo, hackers etc..

There's very little advantage in using extensionless URLs. The primary advantage is the ability to change technologies or programming languages. That is, for example, you could easily switch from .html to .php with a single instruction to your server. The security advantage is miniscule since there are generally many other signals that would give hackers the same information. There is no SEO benefit.

there are seo negatives
what is www.url/file
script, css, image, executable, compiled application, all are file with no prompting extension, what do SEBots do,
Occam's razor response: they leave
Why waste time on something the owner does not want to be found

(Occams Razor: The simplest solution is often the best)

note to OP: browse the web, any hidden file extensions?

reminder...u must not do that if u work with open source code...

Search engine robots do not skip or ignore extensionless URLs. They rely on the MIME-type information in the HTTP response header to determine the file type and proceed from there to analyze the content.

It's personal choice.

You can go to facebook.com/index.php and to google.co.uk/imghp. Both respectable sites that obviously rank very highly on search engines. To be honest, the world would've taken a nasty turn if bots were going to penalise you for something so small. Social media interaction, quality of code/content, up-to-date contact, number of visitors, advertising, webmaster tools (like robots.txt & sitemap.xml) all matter much MUCH more.

I doubt you will be removed off the top spot for not sorting out your extensions, as it is soo common to remove them.

As I say, it's you deciding if they look nicer (which I think they do), and if they're easy for people to remember. To a complete tech noob, "yoursite.com/offers" is undoubtedly easier than "yoursite.com/offers.html". It's one of these cosmetic things, and hardly ever have any practical pros/cons either way.

Really I think it's up to you to decide if it's worth the time fiddling about to make some of your URLs a little easier to remember.

there are no security benefits of not having an extension because to check what language a site is coded in u can just view source or use sites like builtwith.com to check what technologies ur site uses & then hack it

You can make your own directory"/contact", and have the file inside it to be "index.html", instead of "contact.html"

You can just replace your index file of the page e.g. "page.html" to 'index.html' - Web bwrowsers'see anything with a label 'index' in each sundirectory and load it.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.