-1

When you visit a url like https://www.youtube.com/feed/trending it doesnt have .html or .php. Using html or javascript how would I do this? My website is http://www.artsicleprojects.com and when I go to a page like "Nothing" it says http://artsicleprojects.com/nothing.php. So basically, what I want to do is make it so it says

http://artsicleprojects.com/nothing when you go to the page

Thanks!

Artsicle
  • 137
  • 10
  • use htacess for url rewriting . https://alexcican.com/post/how-to-remove-php-html-htm-extensions-with-htaccess/ OR http://stackoverflow.com/a/6534969/4248328 OR http://php.net/manual/en/security.hiding.php – Alive to die - Anant Dec 30 '16 at 17:01
  • 1
    This is usually accomplished by configuring your webserver properly. For example, Apache may use `RewriteRule` to append an extension behind the scenes or perhaps `AddType` to process untyped (or explicitly named) files through PHP. Questions like this are discussed at [ServerFault @ SE](http://serverfault.com). – Anton Samsonov Dec 30 '16 at 17:04
  • Thanks @Anat! This'll help me alot! – Artsicle Dec 30 '16 at 17:07
  • Check this out- [Semantic_URL](https://en.wikipedia.org/wiki/Semantic_URL). Also you can just put your php files in folders with same names and rename the file as index.php as an easy fix. E.g. `somePath/notes.php` to `somePath/notes/index.php` – xRahul Dec 30 '16 at 17:14
  • "http://artsicleprojects.com/catclicker/index.php" or you can click it yourself if you want proof :) It only works with the main url artsicleprojects.com for me – Artsicle Dec 30 '16 at 17:20
  • Possible duplicate of [How to remove file extension from website address?](http://stackoverflow.com/questions/6534904/how-to-remove-file-extension-from-website-address) – Tim Dec 30 '16 at 17:47
  • No, that one didn't help as much – Artsicle Dec 30 '16 at 18:12

1 Answers1

0

OK, so you'd take your nothing.html/nothing.php file, change the name to index.html or index.php, then create a folder called 'Nothing', and put your index file there. Then go to www.example.com/nothing, and the index.html/index.php would automatically run without showing in the URL.


Did this help? If so, please accept my answer. :)

  • I see you have `http://www.artsicleprojects.com/exittheroom/index.php`. Simple remove the /index.php and the page will run the exact same. – sdgsdg sdfgsg Dec 30 '16 at 17:39