Redirection Probem

I have a script which uses the example redirect code below to display specific pages.


<?php
	
	$qstring = explode ( "/" , $_GET["qstr"] ) ;
	switch ( $qstring[0] )
	{
		case "c-WatchList" :
			include ( "watchlist.php" ) ;
			break;
		case "Admin" :
			header ( "location:".base_url."Admin/index.php" ) ;
			exit ( ) ;
			break;
		default :
			include ( "home.php" ) ;
			break;
	}

?>

I have installed Wordpress in a subdomain on the same host. The Wordpress installation completed successfully but the script seems to be conflicting with how Wordpress links to pages like admin, index.php, etc. I have tried adding the line of code below to the scripts redirect php but I still can’t access Wordpress.

		case "blog" :
			include ( "blog/index.php" ) ;
			break;

Any suggestions as to how I can solve this?

Hi,

Do you have WordPress using friendly paths? If so you will have to translate the base path with a similar approach to the renaming option you choose in wordpress.

What is the error you are getting?

Steve

Hi Steve,

I’m not able to access the admin dashboard to check if Wordpress is using friendly paths. I’m not getting any error messages, however when I type “www.mysite.com/wordpress” in the browser it takes me to the default index of the other script I’m using. Basically, any index.php file redirects to the other scripts default home path. Would it possible to rename the Wordpress index.php to something else and have that serve as the default wordpress index?

@onedee,

Many thanks for your private message unfortunately I have never used WordPress.

You mentioned that you are not getting any error messages so I suggest using the following script and working from “postives”:



<?php
  #DEBUG
  if(1) // change 1 to 0  to hide
  {
      error_reporting(-1);  ini_set('display_errors', TRUE);

      echo __LINE__ .'<br />';
      echo '<pre>';
        print_r( $_GET );
      echo '</pre>';

      echo __LINE__ .'<br />';
  }

  $qstring = explode ( "/" , $_GET["qstr"] ) ;

  #DEBUG
  if(1) // change 1 to 0  to hide
  {
    echo '<pre>';
      print_r( $qstring );
    echo '</pre>';
    echo __LINE__ .'<br />';
   die;
  }


    switch ( $qstring[0] )
  {
    ...
    ...
    ...
  }

Hi John,

Thanks for dropping by, I tried a slightly different approach and it worked. Everything is working now…

For the benefit of others who may have a similar problem…

Do you mind sharing your solution?

Yeah, I basically created a new folder outside the main root.