chrisguk Posted March 26, 2012 Share Posted March 26, 2012 Hi, Up until now I have been using the following .htaccess content: Code: RewriteEngine On RewriteCond %{REQUEST_URI} !\/$ RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond $1 !^robots\.txt$ RewriteRule ^([^/]+)/? index.php?p=$1 [L,QSA] There has been no issue with the way it works until I want to do something more. Example of my webpages: index.php home.php contact.php video.php music.php include/header.php include/footer.php My "index.php" pulls the pages in using switch: PHP Code: $page = isset($_GET['p']) ? $_GET['p'] : 'home'; switch($page) { case etc etc........ include('include/header.php'); include(''.$page.'.php'); include('include/footer.php'); Now the problem I have is within the "video.php" file I have a link that goes to another file within a directory folder. The folder location is: /video/newlist.php But the problem I have is when I select the "video.php" link it takes me to the video folder and not the file called "video.php" Is there anyway around this? Link to comment https://forums.phpfreaks.com/topic/259759-mod_rewrite-multiple-directories/ Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.