Rewrite breaking all my images :(

# htaccess rewrite modules for ccp
######
RewriteEngine On
# don't write category.php
RewriteRule ^category\.php - [L]
Rewriterule ^cat/(.+) category.php?$1 [L]

I found "RewriteRule ^.+/images/?(.*)$ /images/$1 [R=301,L]" -- but the thing is, that only allows images to be in root level/images :( and I have an administration interface /ccp/ that also has images and css folders etc that will also need to utilize that.  So in putting that rule in, it basically takes away the ccp's images folder so that isn't acceptable.  Sadly, though, I can't figure out what I can do but I need to assume there are going to other images folders within sub folders and they will need to work :(  Anyways onto the other part below.

Basically with this rewrite, as you can see, I'm trying to rewrite a url like this /cat/soda/coke/cola/can or /cat/soda/coke/cola/bottle or infinite other categories / sub categories.

Basically all of my images on category.php (the page I rewrite to) are broken :(  And I can't figure out how to write my rewrite rule to where it actually shows the images even if the browser is pointed /cat/whatever/im/at/... etc...

Any help is much appreciated!
LVL 1
lamerhooDJVAsked:
Who is Participating?
 
caterham_wwwCommented:
You can try to use a <base href="http://example.com/">

One very simple way to prevent this relative linking problem is to use dashes instead of slashes.
0
 
lamerhooDJVAuthor Commented:
Also, just so you know, the images can be directly accessed so it isn't blocking or rewriting the folder.  I'm lost.
0
 
lamerhooDJVAuthor Commented:
I have found that <img src="/images/file.ext"> works... but I'd like to know if there are any other ways.
0
 
lamerhooDJVAuthor Commented:
Ack, also urls have an issue :(
0
 
lamerhooDJVAuthor Commented:
hmm true true
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.