.htaccess or something adds additional stuff to the URL. PHP -


i started work .htaccess on website i'm working on. works fine, when try acces user.php file located on index, keep getting url:

http://lifeline.andornagy.info/user/?url=user

on every other file , place, works great.

this function call different pages depending on url :

  public function lifeline() {         global $templatepath;         if ( isset($_get['url']) && $_get['url'] !== 'user'  ) {                     $url = $_get['url'];             $result = mysql_query("select * posts url='$url' ");             if ( !mysql_num_rows($result) ) {                 if ( file_exists($templatepath.'404.php') ) {                     include_once($templatepath.'404.php');                 } else {                     include_once('404.php');                 }             }              while($row = mysql_fetch_assoc($result)){                  if ( $row['type'] === 'post' ) {                     include_once($templatepath.'post.php');                 } elseif ( $row['type'] === 'page' ) {                     include_once($templatepath.'page.php');                 }             }         } elseif ($_get['url'] === 'user') {             include_once($templatepath.'user.php');         } else {             include_once($templatepath.'index.php');         }     } 

and .htaccess file.

options +followsymlinks -multiviews  rewriteengine on  rewriterule ^([a-za-z0-9_-]+)$ index.php?url=$1 rewriterule ^([a-za-z0-9_-]+)/$ index.php?url=$1  rewriterule ^(.+)(\s|%20)(.+)$ /$1-$3 [r=301,qsa,l,ne]  errordocument 404 /404.php 

and if url this:

http://lifeline.andornagy.info/user

without /?url=user

sorry if sound noobish. :(

without examining closely, last rewriterule in .htaccess includes [r=301], making rule capable of "adding" (i.e. redirecting to) /?user=x. i'd take closer @ last rule.


Comments

Popular posts from this blog

SPSS keyboard combination alters encoding -

Add new record to the table by click on the button in Microsoft Access -

CSS3 Transition to highlight new elements created in JQuery -