PHP com port communication In Hindi | Write on com port in PHP
Bubble Sort in PHP With Example | How Bubble Sort Works in PHP
Selection Sort in PHP With Example | How does selection sort work in PHP ?
PHP object Type Casting In Hindi | PHP object In Hindi
Computer Basic Knowledge in Hindi
Back end developer roadmap : how to became back end developer ? back end development kya hai?
JavaScript eval() Function In Hindi | JS eval() Function
session Storage In JavaScript In Hindi | JS session Storage In Hindi
If tutorials available on this website are helpful for you, please whitelist this website in your ad blocker😭 or Donate to help us ❤️ pay for the web hosting to keep the website running.
Image By pixabay
core PHP में बनाये गए applications में developers के लिए यह important हो जाता है कि सभी security rules follow किये जाए ताकि application secure रहें।
security के मामले में काई ऐसी simple techniques हैं जिन्हे follow करके हम app को secure कर सकते हैं , इन्ही में से एक है URL से .php
को remove करना।
●●●
Normally , core PHP में जब हम app बनाते हैं तो उसका URL
file name पर depend होता है आग हम कोई routing package use नहीं कर रहे हैं।
For example , आपकी website का नाम test.com
है , तो बाकी के लिए URLs कुछ इस तरह से होंगे -
test.com/aboutus.php
test.com/contactus.php
test.com/terms-and-conditions.php
अब अगर आप थोड़ा ध्यान देंगे तो हर URL के बाद में .php
आ रहा है , जो न तो SEO
के हिसाब से सही है और security के हिसाब से तो बिलकुल भी नहीं।
इस .php
extension से किसी भी normal hacker / human को पता चल जायगा कि आपकी website PHP में बनाई गयी है , जिससे उसे hack करने के लिए एक रास्ता मिल जायगा।
तो इस blog में हम यही सीखेंगे कि URL में आ रहे .php
को कैसे remove करें। नीचे कुछ अलग अलग examples दिए गए हैं , URL
में दुसरे extension को show करने या remove करने के लिए।
इन सभी configurations को .htaccess file में किया जाता है जो आपके project की root directory में होती है।
AddType application/x-httpd-php .asp .py .pl
AddType application/x-httpd-php .bop .foo .133t
या इसे HTML
code के रूप में hide कर सकते हैं , जिससे performance भी अच्छी होगी क्योंकि सभी HTML को PHP engine के माध्यम से parse
किया जाएगा।
AddType application/x-httpd-php .htm .html
हालाँकि आप php.ini
और httpd.conf
file में changes करके भी php extension को hide कर सकते हैं।
// File : php.ini expose_php=Off // File : httpd.conf ServerSignature Off
●●●
I Hope , अब आपको समझ आ गया होगा कि कैसे URL में .php
extension को hide करते हैं।
Loading ...
Hi ! My name is Rahul Kumar Rajput. I'm a back end web developer and founder of learnhindituts.com. I live in Uttar Pradesh (UP), India and I love to talk about programming as well as writing technical tutorials and tips that can help to others.
Get connected with me. :) LinkedIn Twitter Instagram Facebook