.htaccess files not working and how to rename files using htaccess -
I am using the script below to hide the file extension in my website. I got this script from Net
RewriteCond% {REQUEST_FILENAME} at RewriteEngine! -d RecoveryCound% {REQUEST_FILENAME} Php -f rewrite rule ^ (. *) $ $ 1.php but this script is not working, no error is seen, but its file extension is not hidden Can you tell me what is happening in this..I am new to this script ..
And can you tell me how to rename my PHP and show HTACAC in the URL Use (to prevent hacking)
(like www.website.com/contact.php www. Website.com/Mycontact)
If you are in www.site.com/contact If you type, the provided code should work, you can access www.site.com/contact .php?
To rename your PHP, you must make .htaccess very specific:
Rewrite rules < / Pre> Maybe it is better to do some other things in these lines:
Rewrite rules ^ (. *) $ Loader.php? P = $ 1 and then loader.php is something like this code:
$ pages = array (); $ Pages ['macantact'] = 'contact.php'; If $ ($ _GET ['p']) and isset ($ pages [$ _GET ['p']]) $ pages [$ _GET ['p']]; Else // Redirect to the homepage header ('Location: http://www.site.com/'); or with a switch
switch ( $ _GET ['p']) {case "Mycontact": 'contact.php' is required; break; default: header ('location: http://www.site.com/')}}
Comments
Post a Comment