guest2013-1
guest
- Joined
- Aug 22, 2003
- Messages
- 19,800
- Reaction score
- 13
Oh, I thought we were measuring when you started with your CentOS. Sorry.
And of course I can run PHP on a Windows server. If you can't, then you have lost all credibility in my view.
Would I want to run PHP on Windows? Well, that is a different question. But, yes, I most definitely can. How many web developers do you give access on your webserver to change htaccess files? Really? Brave man.
And really, really: If you can't say something helpful, then rather stay quiet.
I was extremely helpful giving him (the dev) the knowledge to simply and EASILY implement what he wanted without having to add-on several hours/weeks of dev time to implement a new framework.
Of course you CAN run PHP on Windows...
Since he is the dev for this project, I assumed he already has access to htaccess. Not sure about how your policies work, but we usually have a hierarchy when it comes to making things live with dev/test/live environments and full test cycles.
It's really a 5 minute process for him to get url rewriting done as simply/cheaply/easily if he'd like. MagicDude4Eva had a good point to use /xx/ instead, but it's pretty easy setting up 1 rule in htaccess to rewrite everything to 1 PHP file, then have that 1 PHP file determine where to rewrite to, an example is:
$uri_arr = array();
$uri = $_SERVER['REQUEST_URI'];
$uri_arr = explode('/',$uri);
$uri_arr = array_filter($uri_arr); //remove any empty elements
$uri_arr = array_values($uri_arr); //reset key values to exclude any null references
switch (count($uri_arr)) {
case 1:
//1 http://example.com/keyword
$keyword = str_replace("-"," ",$uri_arr[0]);
include($_SERVER['DOCUMENT_ROOT']."/detail.php");
break;
....etc
Many ways he can do it. I gave him the simplest/easiest method
And just to touch on htaccess "access" again. If you follow proper best practices, security will never be an issue even if you give a total n00b access to your .htaccess file.