Jump to content

Recommended Posts

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.