Forum Moderators: coopster

Message Too Old, No Replies

Odd problem dealing with Mod Rewrite

Every time I redirect a url my pics and things quit working.

         

xgrewellx

12:40 am on Dec 14, 2007 (gmt 0)

10+ Year Member



Ok, I have this new social networking project called blawggr that I am starting. I set up a .htaccess file that made a rewrite of urls that were like this: http://example.com/user/username so it would take you to http://example.com/profile.php?user=username .

Heres the actual file:

RewriteEngine on
RewriteRule ^user/([^/\.]+)?$ profile.php?user=$1 [L]

If you go to this actual live profile http://example.com/user/grewell912 it takes the stylesheet and makes the links contain /user/. Does anybody have a solution to this.

Thanks

Ryan

[edited by: dreamcatcher at 12:55 am (utc) on Dec. 14, 2007]
[edit reason] use example.com / thanks [/edit]

xgrewellx

12:50 am on Dec 14, 2007 (gmt 0)

10+ Year Member



Figured it out....

The problem seems to be that the stylesheet and the images use the /user/ as a folder path. I simply put ../ in front of them.

Ryan

jatar_k

2:21 pm on Dec 15, 2007 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Welcome to WebmasterWorld xgrewellx,

often using relative paths using ../ can cause problems, especially with php where files can get included anywhere in the directory structure

glad you figured it out