Jump to content

url help


irkevin

Recommended Posts

Hi,

 

I don't know if this is the right place to post this, if it isn't, please move it.

 

I'm trying to use ur mod-rewrite to make my url look nice. Here is the code

 

Options +FollowSymLinks
Options +Indexes
RewriteEngine On
RewriteRule ^completed/([0-9]+)/$ /index.php?page=CompledSeries&id=$1 [NC,L]

 

the dynamic url is http://www.mu-anime.com/index.php?page=CompletedSeries&id=1

 

and using mod_rewrite, its like this http://www.mu-anime.com/completed/1/, but the only problem is that it doesn't display my images and also, the css isn't working anymore..

 

Why is it so?

Link to comment
https://forums.phpfreaks.com/topic/142786-url-help/
Share on other sites

Because of the new url the browser thinks your in a different directory so if your css used to be...

 

root/css/default.css

 

it's now going;

 

root/completed/1/css/default.css

 

which doesn't exist (same for images)

 

What you want is the full http://url when calling files. You can set this in a variable in a common include page then use that variable, so an image would be

 

<img src="<?php echo $YOUR_SITE_URL ?>images/the_imag.jpg" />

Link to comment
https://forums.phpfreaks.com/topic/142786-url-help/#findComment-748404
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.