Forum Moderators: phranque

Message Too Old, No Replies

mod rewrite, relative paths, hot to let browser know that we are at /

         

BuTAMuH

9:46 am on Feb 22, 2007 (gmt 0)

10+ Year Member



I am writing a specific mod for phpBB

At the beginning it supposed that it will be used like:

[domain.com...] goes here (rawurlencode('tags goes here')) - this url opens new page, everything works ok.

Than customer asks me to make so:

[domain.com...]

i've added to .htaccess :
RewriteRule ^search/(.*)$ tags.php?tag=$1 [QSA,L]

Than problem appears, phpBB uses Relative paths, that us why all images, browser forms incorrect paths like [domain.com...]

My question is:

Is is possible to let browser know (using mod_rewrite or something else) that he (browser) at root folder (/)?

jdMorgan

5:07 pm on Feb 22, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



You can't tell the browser without sending an external redirect response, which defeats the whole purose of the internal rewrite by exposing the script's URL.

An alternative would be to detect the image, CSS, and external JS request URLs, and strip the "/tags/goes/here" path information out of those requests using an internal rewrite.

Jim