PHP Error Control Operator In Hindi | Error Control In PHP
PHP Null Coalescing Operator In Hindi , Null Coalescing Operator kya hai ?
PHP Program to check whether number is Palindrome or not | PHP Find Palindrome Number
PHP object Type Casting In Hindi | PHP object In Hindi
Linux uname command Example | Linux get OS Info
session Storage In JavaScript In Hindi | JS session Storage In Hindi
JavaScript eval() Function In Hindi | JS eval() Function
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.
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 ! I'm Rahul Kumar Rajput founder of learnhindituts.com. I'm a software developer having more than 4 years of experience. I love to talk about programming as well as writing technical tutorials and blogs that can help to others. I'm here to help you navigate the coding cosmos and turn your ideas into reality, keep coding, keep learning :)
Get connected with me. :) LinkedIn Twitter Instagram Facebook