Lighttpd rewrite messes up template

natli

New Member
Reaction score
0
Urls to my website were kind of odd/ugly so I added a rewriting url to make it go from
wxw.website.x/index.php?fo=43534tgreger43&f=lalalalala.ext
to
wxw.website.x/dl/43534tgreger43/lalalalala.ext

Code:
url.rewrite-once = (
"^" + wpdir + "dl/(.+)/(.+)$" => wpdir + "/index.php?fo=$1&f=$2"
)

It works just fine, but it messes up the template because img links etc. are relative.
So what used to be:
wxw.website.x/images/logo.gif
in the old url, is now:
wxw.website.x/dl/43534tgreger43/images/logo.gif

Can anyone help me fix this?
 

Magentix

if (OP.statement == false) postCount++;
Reaction score
107
Exclude with the -f and -d flag so it won't rewrite URLs that actually lead to a file or directory
 

natli

New Member
Reaction score
0
Could you give an example? Can't find anything on google.

By the way,
wxw.website.x/index.php?fo=43534tgreger43&f=lalalalala.png
may very well be rewritten to
wxw.website.x/dl/43534tgreger43/lalalalala.png

What I mean by that is, the rewriting is *supposed* to work for image files, archive files (rar/zip etc.). Basically any filetype at all. So would those flags even work to begin with?
 

Samuraid

Advisor
Reaction score
81
Exclude with the -f and -d flag so it won't rewrite URLs that actually lead to a file or directory

Unfortunately, that's Apache's syntax and won't work for lighttpd.

In lighttpd, If you want to skip rewriting if the URL actually points to a real file, make sure to use: url.rewrite-if-not-file = "<pattern>"
 
General chit-chat
Help Users
  • No one is chatting at the moment.

      The Helper Discord

      Members online

      No members online now.

      Affiliates

      Hive Workshop NUON Dome World Editor Tutorials

      Network Sponsors

      Apex Steel Pipe - Buys and sells Steel Pipe.
      Top