Jump to content

[SOLVED] htaccess redirect


ykarmi

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

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.