How to hide extension of html and php file.?

277
3601

welcome back to shortlearner.com , In this tutorial  we will see how to hide extension of files using .htaccess
before start learning first of all we should  know about .htaccess file
what is .htaccess

hide extension of url using htaccess
in a simple words we can say that the .htaccess is a configuration file for use on web servers running the
Apache Web Server software. When a .htaccess file is placed in a directory
which is in turn ‘loaded via the Apache Web Server’,
then the .htaccess file is detected and executed by the Apache Web Server software.

Also Read :
PHP Login Script With Remember me.
Change password using javascript, php and mysqli.
Password and Confirm Password Validation Using JavaScript
Check Email is Already Registered in Database using Ajax and JavaScript.
How to hide extension of html and php file.?

Benefits of using .htaccess

  • Redirect the user to different page
  • Password protect a specific directory
  • Block users by IP
  • Preventing hot linking of your images
  • Rewrite URIs
  • Specify your own Error Documents

In this tutorial we make 3 php pages and hide there extensions using .htaccess file.
index.php

<!DOCTYPE HTML>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <title>Remove .php extension with .htaccess by http://mainvps.shortlearner.com/</title>
         
        
        
    </head>
<body>
 
<center>

<div id="menu">
<ul>
	<li><a href="index">home</a></li>
    <li><a href="login">login</a></li>
    <li><a href="signup">signup</a></li>
  
</ul>
</div>

<div id="body">

<h1>This is index.php page | see the url in addressbar</h1> <br />


</div>
</center>
 
</body>
</html>

Signup.php

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <title>Remove .php extension with .htaccess by http://mainvps.shortlearner.com/</title>
         

        
    </head>
<body>
 
<center>

<div id="menu">
<ul>
	<li><a href="index">home</a></li>
    <li><a href="login">login</a></li>
    <li><a href="signup">signup</a></li>
   
</ul>
</div>

<div id="body">

<h1>This is signup.php page | see the url in addressbar</h1>

</div>
</center>
</body>
</html>

Login.php

<!DOCTYPE HTML>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <title>Remove .php extension with .htaccess by http://mainvps.shortlearner.com/</title>
         
        <link rel="stylesheet" href="style.css" type="text/css" />
        
    </head>
<body>
 
<center>

<div id="menu">
<ul>
	<li><a href="index">home</a></li>
    <li><a href="login">login</a></li>
    <li><a href="signup">signup</a></li>
   
</ul>
</div>

<div id="body">

<h1>This is login.php page | see the url in addressbar</h1><br />



</div>
</center>
</body>
</html>

Save below code with .htaccess

<IfModule mod_rewrite.c>
RewriteEngine on

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^(.*)$ $1.php


RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}.html -f
RewriteRule ^(.*)$ $1.html


</IfModule>

 

277 COMMENTS

  1. I’m often to blogging and i really appreciate your content. The article has actually peaks my interest. I’m going to bookmark your web site and maintain checking for brand spanking new information.

  2. This is the right webpage for anybody who wants to understand
    this topic. You know so much its almost hard to argue with you (not
    that I personally will need to…HaHa). You definitely put a brand
    new spin on a subject that’s been written about for decades.

    Excellent stuff, just excellent!

  3. naturally like your web site however you need to take a look at the spelling on several of your posts. A number of them are rife with spelling problems and I find it very bothersome to tell the truth on the other hand I will surely come again again.

  4. Unfortunately, there are plenty of online casinos that are either not trustworthy or don’t have the best customer service technology to give you the great online experience you’re after. Don’t worry! Every site we recommend has been fully vetted and checked so you can play with confidence. Concerned about a site? Check our Blacklisted Casino page for a full list of online casinos you should definitely avoid as well as tips and guidance for steering clear of any others you find. This site is all about gambling in Canada, both online and offline. Here you can get more information on gambling in the country, alongside recommendations for the best online and live casinos for Canadian players. Below you will find pages for each province that explain the specific legal situation and the options you have for gambling, no matter where you are in Canada. If you are looking for Canada’s top live casinos, you can find 6 recommended at the bottom of this page.
    http://dopalator.5v.pl/member.php?action=profile&uid=8513
    Playing live dealer roulette is exactly the same as playing online Roulette or playing in a land-based casino. Simply find a casino site that offers live Roulette and select the game. Once you’re in the game, decide what bets you would like to make and how much money you’d like to wager. Once the betting is over, the dealer spins the wheel. Even though it might not have been the case in the past, live roulette and other live dealer table games are now basically as wide-spread as any other popular type of casino games. If you choose any reputable casino from our general list of top casino websites, you are very likely to discover live-dealer games in the lobby. That being said, if you want to be sure, stick to the list of casinos you can see on this page.

  5. An impressive share! I’ve just forwarded this onto a
    co-worker who was conducting a little homework on this.
    And he in fact ordered me dinner because I stumbled upon it for him…
    lol. So allow me to reword this…. Thank YOU for the meal!!

    But yeah, thanx for spending time to talk about this topic here on your site.

  6. Wow quite a lot of good knowledge!
    good essay writing service [url=https://essayservicehelp.com/]online essay writing services[/url] application essay writing service

  7. When some one searches for his vital thing, so he/she desires to be available that in detail, so that thing is maintained over here.

  8. Hi! I’m at work surfing around your blog from my new iphone 4! Just wanted to say I love reading your blog and look forward to all your posts! Keep up the fantastic work!

  9. how to buy cheap mobic for sale [url=https://mobic.store/#]where to buy mobic tablets[/url] where can i get cheap mobic for sale

  10. Fantastic goods from you, man. I have understand your stuff previous to and
    you are just too magnificent. I actually like what you have acquired here,
    really like what you are stating and the way in which you say
    it. You make it enjoyable and you still care for to keep it wise.
    I can not wait to read much more from you.
    This is really a wonderful website.

  11. [url=https://propecia1st.science/#]cost of generic propecia for sale[/url] order cheap propecia tablets

  12. I was recommended this web site by my cousin. I am not sure whether this post is written by him
    as nobody else know such detailed about my problem. You’re amazing!
    Thanks!

  13. Usually I do not learn post on blogs, however I would like to say that this write-up very compelled me to check out and do so!
    Your writing taste has been amazed me. Thanks, quite nice post.

  14. Hey would you mind sharing which blog platform you’re using?
    I’m going to start my own blog in the near future but
    I’m having a difficult time selecting between BlogEngine/Wordpress/B2evolution and Drupal.

    The reason I ask is because your design and style seems different then most blogs and I’m looking for something completely unique.
    P.S Apologies for being off-topic but I had to ask!

  15. comprar carta de condução, comprar carta de condução ,comprar carta de condução verdadeira ,comprar carta de condução portugal ,comprar carta de conducao, comprar carta de condução preço, comprar carta de condução urgent ,comprar carta condução
    comprar carta de condução online ,comprar carta de mota
    como comprar a carta de condução.
    https://cartadeconducaoonline.com/

  16. köpa körkort, ta körkort i polen, köpa körkort utomlands, köpa svenskt körkort ,ta körkort utomlands, fake körkort, köpa falskt körkort, köpa körkort rumänien, utländskt körkort, körkort online, körkort bild
    körkort sverige ,svensk körkort ,köpa körkort i sverige ,falskt körkort ,köpa ett körkort, köp svenskt körkort ,kan man köpa körkort
    fejk körkort köra med utländskt körkort i sverige
    https://kopa-giltigtkorkort.com/

  17. I’m often to blogging and i really appreciate your content. The article has actually peaks my interest. I’m going to bookmark your web site and maintain checking for brand spanking new information.

  18. WSOP bracelet winner David Williams wasn’t the first person to successfully transition from Magic: The Gathering to poker and, according to Williams, he won’t be the last. But, as Williams was quick to point out, Magic can prepare you for a lot more than poker. Take it slow! There is no need to jump into high stakes and try to get rich. Also realize that you know nothing about poker and start with the basics. Just like Magic is a huge game, poker is a huge game. Remember that it likely took you a long time to get good at Magic and poker will be the same. The Blind Three Card Monte is more like a mind-reading card trick where you guess the card the spectator selects mentally. From a standard pack of playing cards, The magician removes the Q♥️ Aв™ЈпёЏ and Aв™ пёЏ cards and places them face-up in front of the spectator. The spectator is asked to think of any one of the three cards, flip them face down and mix them up while the magician turns their back. The magician then looks at each card and tells the exact card on the spectator’s mind. https://rpgplayground.com/members/aviatorapping/profile/ You can play at Mari888 slot machine casino Malaysia via a variety of methods. Mari888 casino accepts many types of payment methods including bank transfer, eWallets, online banking solutions, and Zoom payments. All transactions have receipts that confirm payment. You can use these to make deposits and withdrawals. The minimum deposit amount is RM50. Mari888 also accepts Bitcoin as a form of payment. You won’t have to wait long to receive your winnings. Slot machines are the most popular game in online casinos and on sweepstakes sites. It would not be unreasonable to expect online slots promos in Riversweeps. slot creditfree Earn 1 Reward Credit for every $5 of slot coin-in. Play at OngMari online casino, where players are assured of a great variety of games featuring the best payouts and thrilling bonuses. With an easy-to-use interface on OngMari, our platform is at the forefront for Malaysian slot game lovers. Play the best online casino games from the comfort of your home and enjoy the best odds on our site.

  19. best india pharmacy [url=https://indiapharmacy.cheap/#]online shopping pharmacy india[/url] top 10 online pharmacy in india

  20. Thanks for a marvelous posting! I genuinely enjoyed reading it, you are a great author.I will always bookmark your blog and will often come back down the road. I want to encourage continue your great job, have a nice weekend!

  21. To understand verified news, adhere to these tips:

    Look in behalf of credible sources: https://co2living.com/pag/what-happened-to-sam-brock-nbc-news-the-latest.html. It’s important to safeguard that the expos‚ roots you are reading is worthy and unbiased. Some examples of reputable sources include BBC, Reuters, and The New York Times. Review multiple sources to pick up a well-rounded understanding of a discriminating news event. This can better you return a more ended paint and avoid bias. Be hep of the position the article is coming from, as flush with good hearsay sources can compel ought to bias. Fact-check the gen with another commencement if a scandal article seems too sensational or unbelievable. Forever pass inevitable you are reading a advised article, as scandal can change-over quickly.

    By means of following these tips, you can fit a more au fait rumour reader and best understand the beget here you.

  22. Бурение скважин сверху водичку – этто эпидпроцесс образования отверстий в течение подсолнечной чтобы извлечения подземных вод. Эти скважины используются для питьевой воды, сплав растений, индустриальных нищенствования и других целей. Эпидпроцесс бурения скважин охватывает в течение себя эксплуатация специального оснащения, таковского яко буровые направления, коим проникают в течение матушку-землю и еще основывают отверстия: https://pastelink.net/pnudooox. Эти скважины элементарно владеют глубину через пары десятков ут нескольких сторублевок метров.
    После создания скважины, спецы проводят тестирование, чтоб предназначить нее эффективность а также качество воды. Через некоторое время скважина снабжается насосом и другими государственное устройство, чтоб обеспечить постоянный путь для воде. Эмпайр скважин сверху водичку представляет собой принципиальным движением, яже дает обеспечение путь для аккуратной хозпитьевой восе а также используется в различных отраслях промышленности. Что ни говорите, этот эпидпроцесс что ль иметь отрицательное суггестивность сверху брать в кольцо слой, поэтому что поделаешь выдерживать должные философия и регуляции.

  23. Бурение скважин на водичку – этто эпидпроцесс создания отверстий в течение свете для извлечения находящийся под землей вожак, коие смогут прилагаться чтобы различных целей, включая питьевую водичку, увлажнение растений, промышленные нищенствования и другие: https://ctxt.io/2/AABQoVjsEA. Для бурения скважин используют специализированное ясс, таковское как бурильные установки, коим проникают в течение землю а также основывают дыры глубиной от нескольких 10-ов ут пары сотен метров.
    Через некоторое время произведения скважины проводится стресс-тестирование, чтобы сосчитать ее производительность и качество воды. Через некоторое время щель оборудуется насосом и еще другими системами, чтобы поставить постоянный доступ для воде. Хотя бы бурение скважин сверху воду представляет необходимую роль на обеспечении доступа для истой питьевой водево а также используется в различных секторах экономики индустрии, этот процесс может оказывать негативное воздействие на обступающую среду. Поэтому что поделаешь соблюдать соответственные правила а также регуляции.

  24. Nicely expressed without a doubt. !
    research paper writing services [url=https://essaywritingservicelinked.com/]essay writing service list[/url] reddit writing service [url=https://essaywritingservicetop.com/]best essay writing service 2016[/url] essay writing service review one on one resume writing service [url=https://helpwithdissertationwriting.com/]dissertation editing help[/url] psychology dissertation help [url=https://dissertationwritingtops.com/]dissertation proposal writing services[/url] psychology dissertation writing service

  25. To sign up for a new account, open the app and select the ‘New to PokerStars? Sign up’ option. There are a few simple steps to create your account. You will need to enter a valid email address, and create a User ID (username). When you have agreed to the PokerStars End User License Agreement press ‘Finish’. With PokerStars, you can start out with micro real money cash game stakes or with their plentiful play-money options. You can play their SCOOP Events (with buy-in levels of Low, Medium, and High) or a collection of freerolls that you want to grind. Either way, PokerStars remains one of the best poker apps and the top place to play poker online for money. Qualify online to play at Live PokerStars events in Live Card Rooms or Major Tournaments. Live card rooms include: Macau, Manila or the Hippodrome Casino in London. Major tournaments are the Brazilian Series of Poker (BSOP), The Asia Pacific Poker Tour, The European Poker-tour or The PokerStars No Limit Holdem Championship. Watch Canadian poker pro Daniel Negreanu’s greatest moments playing PokerStars live poker events.
    https://www.drupalgovcon.org/user/527956
    Online Roulette is ideal for those who like games that keep them guessing. Although there are certain bets designed to suit certain gambling styles, Roulette is a game of luck, and it’s that luck that makes every spin of the reel a thrill. Whether you prefer classic European or American types or want to try out unique variations like multi-wheel or live croupier options, online roulette casinos feature a vast selection of games to suit any player’s preferences. Ready for the rush of adrenaline that comes with spinning the wheel? Discover our top-recommended roulette sites with the hottest real-money games and receive an enticing welcome bonus to get started. Yes, you can play all roulette games out there from a handheld device, whether that is a smartphone or a tablet. You will be able to pick any version of roulette and test it or play it for real money right from your portable device. All roulette games on our site are mobile-friendly.

  26. Europe is a continent with a in clover annals and diverse culture. Lifestyle in Europe varies greatly depending on the provinces and область, but there are some commonalities that can be observed.
    Unified of the defining features of life in Europe is the strong stress on work-life balance. Profuse European countries have laws mandating a guaranteed amount of vacation all together for workers, and some procure reciprocate experimented with shorter workweeks. This allows as a replacement for more circumstance spent with kinsfolk and pursuing hobbies and interests.
    https://www1.352.com.ng/news/anna-berezina-meeting-colleagues-in-spain-next.html
    Europe is also known for its flush cultural heritage, with numerous cities boasting centuries-old architecture, artistry, and literature. Museums, galleries, and historical sites are bountiful, and visitors can bury themselves in the information and culture of the continent.
    In addition to cultural attractions, Europe is effectively to a wide variety of not incongruous beauty. From the impressive fjords of Norway to the cheery beaches of the Mediterranean, there is no lack of numbing landscapes to explore.
    Of course, spring in Europe is not without its challenges. Multifarious countries are grappling with issues such as gains inequality, immigration, and bureaucratic instability. At any rate, the people of Europe are resilient and obtain a fancy portrayal of overcoming adversity.
    Comprehensive, vigour in Europe is invaluable and varied, with something to offer since everyone. Whether you’re interested in history, refinement, temperament, or simply enjoying a good work-life steadiness, Europe is a horrendous part to request home.

  27. First of all I would like to say terrific blog! I had a quick question which I’d like to ask if you do not mind.

    I was interested to find out how you center yourself and clear your thoughts before writing.

    I’ve had a tough time clearing my mind in getting my ideas out there.
    I truly do take pleasure in writing however it just seems like the first 10 to 15 minutes tend to be lost simply just trying to figure out how to begin. Any recommendations
    or tips? Cheers!

  28. I think the content you share is interesting, but for me there is still something missing, because the things discussed above are not important to talk about today.

  29. Link exchange is nothing else however it is just placing the other person’s weblog link on your
    page at suitable place and other person will also do similar for you.

  30. I have not checked in here for some time since I thought it was getting boring, but the last few posts are great quality so I guess I’ll add you back to my daily bloglist. You deserve it my friend 🙂

  31. Absolutely! Find news portals in the UK can be crushing, but there are tons resources at to cure you espy the perfect in unison because you. As I mentioned already, conducting an online search an eye to https://lodgenine.co.uk/art/jennifer-griffin-s-age-fox-news-anchor-s-birthdate.html “UK hot item websites” or “British information portals” is a pronounced starting point. Not one desire this grant you a encyclopaedic shopping list of communication websites, but it will also afford you with a heartier savvy comprehension or of the current news prospect in the UK.
    Once you obtain a itemize of imminent account portals, it’s critical to estimate each one to influence which overwhelm suits your preferences. As an example, BBC News is known benefit of its intention reporting of news stories, while The Keeper is known quest of its in-depth criticism of partisan and group issues. The Independent is known representing its investigative journalism, while The Times is known in the interest of its affair and finance coverage. By way of concession these differences, you can choose the information portal that caters to your interests and provides you with the newsflash you call for to read.
    Additionally, it’s usefulness all in all close by expos‚ portals for specific regions within the UK. These portals yield coverage of events and good copy stories that are akin to the область, which can be exceptionally cooperative if you’re looking to hang on to up with events in your neighbourhood pub community. In behalf of instance, municipal communiqu‚ portals in London classify the Evening Pier and the Londonist, while Manchester Evening Hearsay and Liverpool Echo are hot in the North West.
    Blanket, there are numberless statement portals accessible in the UK, and it’s high-ranking to do your inspection to see the one that suits your needs. By means of evaluating the unconventional news programme portals based on their coverage, luxury, and article standpoint, you can decide the song that provides you with the most fitting and engrossing low-down stories. Meet fortunes with your search, and I anticipation this information helps you discover the practised dope portal for you!

LEAVE A REPLY

Please enter your comment!
Please enter your name here