htaccess rewrite problem

khasi-khota

New Member
I am in the process of moving a site to another server and I've ran into a problem.The site uses .htaccess to redirect to index.php so the index.php can use $_SERVER['REQUEST_URI'] to load the whatever page is being called... However i cannot find where the old server has the .htaccess rules...so I am doing my own.The .htacess rules I use are:\[code\]RewriteBase /RewriteCond %{REQUEST_FILENAME} !-dRewriteCond %{REQUEST_FILENAME} !-fRewriteRule ^(.+)$ /index.php/?$1 [L,QSA]\[/code\]the URL is newsiteurl.com/racintv/video_view?channel_id=2and by printing out the params on the index.php page I am getting\[quote\] Array ( [page] => racintv/video_view?channel_id=2 )\[/quote\]It should load the video_view page and pass channel_id (which loads a video playlist). This is not the case as it thinks the page to load is actually /video_view?channel_id=2On the old site, I print out the params on the index.php page it prints\[quote\] Array ( [page] => racintv/video_view )\[/quote\]and passes the ?channel_id=2 correctly as the video loads correctlyWhat am I missing in my .httacess that would pass ?channel_id=2 correctly?Here is the PHP code which parses the URI\[code\]$path_info = trim(substr($_SERVER['REQUEST_URI'],1)) ;$var_array = explode('/',$path_info);$num_vars = sizeof($var_array);if ($num_vars==1 or !($var_array[1])) {// in the form of '/foo' or '/foo/' if ($var_array[0] && ! strstr($var_array[0],'index')) { $var_array[1] = 'index'; // use index as the default page $num_vars = 2; }}if ($num_vars >= 2) { // in the form of '/foo1/foo2[/foo3 ...]' $tmp_array = explode('.',$var_array[1]); $var_array[1] = $tmp_array[0]; $page = $var_array[0] .'/'.$var_array[1]; $vars['page'] = $page; $q_str = ''; for ($i=2;$i<$num_vars;$i++) { $key = $var_array[$i]; $value = http://stackoverflow.com/questions/3860743/$var_array[++$i]; if ($key && $value) { $vars[$key] = $value; $q_str .="$key=$value&"; $$key=$value; } }}\[/code\]//end of search engine friendly url parsing
 
Back
Top