Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 179
  • Last Modified:

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!
0
lamerhooDJV
Asked:
lamerhooDJV
  • 4
1 Solution
 
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
 
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:
hmm true true
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now