Fix (1st try) absolute paths for httpd url_rewrites
Thanks to Alan Teeder for guiding me into the right direction
This commit is contained in:
parent
2859400336
commit
c0c82f4f7b
1 changed files with 3 additions and 1 deletions
|
@ -490,9 +490,11 @@ void MongooseHttpd::init()
|
|||
string & rhs = rw_entries[1];
|
||||
if (false == rewrites.empty()) rewrites.append(1, ',');
|
||||
rewrites.append(lhs).append(1, '=');
|
||||
if (rhs[0] == '/') {
|
||||
SGPath targetPath(rhs);
|
||||
if (targetPath.isAbsolute() ) {
|
||||
rewrites.append(rhs);
|
||||
} else {
|
||||
// don't use targetPath here because SGPath strips trailing '/'
|
||||
rewrites.append(fgRoot).append(1, '/').append(rhs);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue