AtomicRax Posted June 17, 2009 Share Posted June 17, 2009 I have an Ubuntu server running apache2 with PHP 5.2.6. I have a few scripts that parse $_SERVER['PATH_INFO'] so I can link to files like this: /index.php/query What I want to do is simply like to: /query The server would parse that as /index.php/query since index.php is default. I've done this before on another server, but don't know how it was configured.... Quote Link to comment Share on other sites More sharing options...
wildteen88 Posted June 17, 2009 Share Posted June 17, 2009 if you're using Apache you can use mod_rewrite to direct all requests to index.php Add the following to a file called .htaccess and place it in the directory where your index.php is located to. rewriteEngine On rewriteRule (.*) index.php/$1 When going yoursite.com/whatever it will actually call index.php/whatever Quote Link to comment Share on other sites More sharing options...
AtomicRax Posted June 18, 2009 Author Share Posted June 18, 2009 [Wed Jun 17 23:47:51 2009] [alert] [client 192.168.2.100] /home/admin/website.inet/.htaccess: Invalid command 'rewriteEngine', perhaps misspelled or defined by a module not included in the server configuration Is this normal? I realize this is turning into an Apache discussion, not php configuration- should this topic be moved? Quote Link to comment Share on other sites More sharing options...
wildteen88 Posted June 18, 2009 Share Posted June 18, 2009 Looks like you need to enable the mod_rewrite module within Apaches configuration. Open Apaches httpd.conf and find then following line #LoadModule rewrite_module modules/mod_rewrite.so Remove the # from the start of the line. Save the httpd.conf and restart Apache. 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.