Jump to content

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

In which ase you should be able to figure this out yourself ;) Either run a query to update all the urls taht are currently in the database, or re-write them as you get them out of the database. You'll also need to work on how you add them if you need a different url format.

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