I spent ages trying to work out mod rewrite but never could so I'm using php to explode the URLs, but I can't manage to get http://www.blah.com/Games to work, only http://www.blah.com/index.php/Games seems to work.
Any advice?
hiding "index.php" in www.blah.com/index.php/Games
Moderator: General Moderators
- seppo0010
- Forum Commoner
- Posts: 47
- Joined: Wed Oct 24, 2007 4:13 pm
- Location: Buenos Aires, Argentina
Does this work for you?
Code: Select all
RewriteEngine on
RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]Sorry. I can't get mod rewrite to work at all. I'm trying to do it all with just php.
The code I have is:
which works if the URL includes "index.php" but it won't work for simply, "www.blah.com/animals/dogs".
The code I have is:
Code: Select all
if(isset($PATH_INFO)) {
$vardata = explode('/', $PATH_INFO);
$urlcat=$vardata[1];
$urlsubcat=$vardata[2];
}... Because you need mod rewrite for that to work.davidtube wrote:Sorry. I can't get mod rewrite to work at all. I'm trying to do it all with just php.
The code I have is:which works if the URL includes "index.php" but it won't work for simply, "www.blah.com/animals/dogs".Code: Select all
if(isset($PATH_INFO)) { $vardata = explode('/', $PATH_INFO); $urlcat=$vardata[1]; $urlsubcat=$vardata[2]; }