Jump to content

Recommended Posts

Hey guys,

I have done an htaccess redirect like this:

 

RewriteEngine on

RewriteRule ^projects/([0-9a-zA-Z-]+)\.html$ /display_project.php?project=$1

 

So that any alphanumeric html page in the folder projects would redirect to display_project.php

Works perfectly.

Now my only problem is that the file display_project.php is really located in the root of the site (not the folder projects) and it required a lot of files located in the root as well. The problem with that is, that when the file calls, say, style.css it calls it from the folder projects though it is really located in the root. As a result the file is not found, and is not used.

 

Is there any way I can force display_project.php to get all the files it requires from the root rather than the folder it (thinks it) is in?

 

If not, what's another solution?

 

Thanks a lot,

ykarmi

Link to comment
https://forums.phpfreaks.com/topic/83690-solved-htaccess-redirect/
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.