PHP Script changing URL structure in all directories

I was just given access to a development server. I created a directory in the public_html folder called "test-site". When I visit http://developmentdomain.com/test-site/ the URL string becomes: http://developmentdomain.com/test-site/?p=test-site

The reason this is happening is because index.php in the root directory is telling all sub directories to add this on the end of the URL. The main site (hosted in the root) needs this file, but I do not want all of the other sub directories to be affected by it. How would I change the following code so it only applies to the root, bot not sub directories? This line is what is causing it: $p = ($_REQUEST['p'] != '' ? $_REQUEST['p'] : 'home');

CODE:

<?
session_start();
$_SESSION['bj'] = 1;
include "db.php";
require_once("classes/layout.class.php");
require_once("classes/content.class.php");
$p = ($_REQUEST['p'] != '' ? $_REQUEST['p'] : 'home');

$layout = new layout();
$layout->startPage($p);
$layout->buildHead($p);
$layout->buildBody($p);

$content = new content();
$content->buildHeader($p);
$content->buildLogoNav($p);
$content->buildPage($p);
$content->buildFooter($p);

$layout->closePage($p);
?>

Answers


It appears that the $_GET parameter is being used as a custom CMS.

  1. Check any rewrite rules.
  2. Review the layout() class
  3. Review your server-side includes classes/layout.class.php & classes/content.class.php

The URL is being modified at some point programatically. Assuming its not a problem due to #1, then keep an eye out for a portion of code that manipulates the header(), i.e. header('Location: some/new/location');


Need Your Help

Convert GeoJSON coordinates to other projection to use with Turf.js

javascript json gis geojson openlayers-3

I have a GeoJSON feature collection using the NAD-83 UTM projection, so the coordinates are in meters. I want to use this feature collection with the Turf.JS library to do some contouring.

Code signing Error: Application failed codesign verification

ios xcode osx-lion

I am very new to iOS development, I have an app all set and ready to be distributed, but I seem to get this error every single time I run the application on my DEVICE only, the iOS simulator works ...