Konsigliare Posted October 29, 2009 Share Posted October 29, 2009 Does not enhance security in any way! I just find it makes your site look more professional! This will allow you to use links such as http://game.net/login rather than http://game.net/login.php All it requires is you to open .htaccess on your public_html folder, via cPanel or FTP Once opened paste: RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME}\.php -f RewriteRule ^(.*)$ $1.php You do not rename any files at all. Any subdirectories you have will also be able to be accessed without .php You can change the .php in the code to whatever your main file extension is This code is not for mccode it works with any .php file, whether it is kiddy porn or mccode If you have dynamic urls (http://game.net/login.php?mode=gay) simply use http://game.net/login?mode=gay) Simple as! Quote Link to comment Share on other sites More sharing options...
Curt Posted October 29, 2009 Share Posted October 29, 2009 hmm...just curious as what this is good for ? does it assist security in anyway ? Quote Link to comment Share on other sites More sharing options...
Joshua Posted October 29, 2009 Share Posted October 29, 2009 Curious if something like this could be integrated into extra security via known sql injects. Going to tinker around with it :) Quote Link to comment Share on other sites More sharing options...
Haunted Dawg Posted October 30, 2009 Share Posted October 30, 2009 All this does is tell the browser to display url http://site.com/file while it's viewing http://site.com/file.php Quote Link to comment Share on other sites More sharing options...
a_bertrand Posted October 30, 2009 Share Posted October 30, 2009 No it doesn't help security. You could also make it work as they was html files, but again no change in security. Maybe your players would wonder what makes your script works, but does that really matter? Quote Link to comment Share on other sites More sharing options...
Joshua Posted October 30, 2009 Share Posted October 30, 2009 So if they enter say a basic cmrket hck or something similar it wouldnt tell them 404 error as page not found? Would it also change their entry into the w/o .php ? Quote Link to comment Share on other sites More sharing options...
Sethenor2 Posted October 30, 2009 Share Posted October 30, 2009 So if they enter say a basic cmrket hck or something similar it wouldnt tell them 404 error as page not found? Would it also change their entry into the w/o .php ? Nope all they do is just take away the .php and enter the hack so they can still do it Quote Link to comment Share on other sites More sharing options...
fbiss Posted October 30, 2009 Share Posted October 30, 2009 You would also have to find and remove every .php from links on your game as well, wouldnt you? Quote Link to comment Share on other sites More sharing options...
a_bertrand Posted October 30, 2009 Share Posted October 30, 2009 yes you would need to. Quote Link to comment Share on other sites More sharing options...
CrazyT Posted October 30, 2009 Share Posted October 30, 2009 You can do that with like a few simple lines.. *hint* ob_start(); *hint* Quote Link to comment Share on other sites More sharing options...
Konsigliare Posted October 31, 2009 Author Share Posted October 31, 2009 You can do that with like a few simple lines.. *hint* ob_start(); *hint* Doubt it, if it can achieve the same result as the little bit of code I posted, do explain Quote Link to comment Share on other sites More sharing options...
Haunted Dawg Posted October 31, 2009 Share Posted October 31, 2009 To remove every .php in the game you simply: function remove_that($content) { return str_replace('.php','', $content); } ob_start('remove_that'); Quote Link to comment Share on other sites More sharing options...
Spudinski Posted November 1, 2009 Share Posted November 1, 2009 A few tips, removing ".php" or any part from a URL doesn't make your website any more "professional looking" or anything for that matter, it just proves YOU are not proud of the fact that, indeed, you use PHP, the mother language of your game. And also, you can redirect the "*.php" pages, to "*", with the exact same thing you used, to in fact, remove it in the first place. Quote Link to comment Share on other sites More sharing options...
Konsigliare Posted November 1, 2009 Author Share Posted November 1, 2009 A few tips, removing ".php" or any part from a URL doesn't make your website any more "professional looking" or anything for that matter, it just proves YOU are not proud of the fact that, indeed, you use PHP, the mother language of your game. And also, you can redirect the "*.php" pages, to "*", with the exact same thing you used, to in fact, remove it in the first place. In your opinion. Unless you are sun-fearing, you wouldn't be proud of a programming language. I have no idea what your last line means. All I'm posting is a few lines of code to paste into a file, that means you can forget about your file extensions. In my opinion and alot of others, it makes the website look more professional and more interesting Quote Link to comment Share on other sites More sharing options...
rulerofzu Posted November 1, 2009 Share Posted November 1, 2009 Both of these are server dependant. Neither will work across all server platforms. Quote Link to comment Share on other sites More sharing options...
a_bertrand Posted November 2, 2009 Share Posted November 2, 2009 Having file extensions or not or using query strings or not will not really change how professional a website will look like. I had a chat the other day with some people and they was trying to convince me to hide query string by making some fake path and filename, when I asked why? They answered well it looks better, it's for the SEO, looks more professional and something like "I will not go to a website which use querystrings and don't have a nice URL". Somehow the discussion stopped when I asked if they use google as google uses querystrings. Now, honestly, how much a website look professional or not, DOES NOT depends on the URL. Actually most people don't even watch the URL line and it doesn't have any impact about visits, search engines or whatever else. This is so true, that I still have a lot of question on my own website asking what do I use to make the game, odd the url state clearly a "nbase.php", I would then think that people know that this .php file means it's using PHP under, right? Well they don't look at it. Don't even answer me that the 2% "web developers" (random number) out there do know and you are doing it for those, as whatever small percent of web developers exists don't make the market. If you remove the extensions, fine, you do it for you as you find it more cool to not see the URL, but don't expect it will actually have any real impact out there. Spend more time on the content of your website, the look of your pages, the usability, etc. That will have lot more effects and this is what makes a website professional or not, not the URL. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.