Page 1 of 1

Extracting from website URL....

Posted: Tue Aug 29, 2006 12:45 am
by Mr Tech
I'm creating a Mod_Rewrite script for a CMS i have created. This is the .htaccess... Same as WordPress:

Code: Select all

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
What I need to do is get the index.php file to extract the url so it can display the correct content...

So if the url was http://www.mydomain.com/dir/subdir/ I could use $var_array[1] and $var_array[2] to read the different directories in the url... This code used to work for me but it isn't anymore...

Code: Select all

$var_array = explode("/",$PATH_INFO);
Does anyone know what code I would replace $PATH_INFO with so I can read the url?

Hopefully I'm making sense....

Posted: Tue Aug 29, 2006 9:17 am
by feyd
look inside $_SERVER.