#apache - Sat 19 May 2007 between 00:00 and 00:24



remotei have the feeling you can help me, i've been playing around trying to write a simple rewrite rule without success... there's something i'm not getting about mod_rewrite for instance when i have one or more rewrite conditions (RewriteCond) followed by a RewriteRule, will the condition(s) apply to other RewriteRule statements ?
noodlremote: no, conditions only ever apply to the next single rule
tyroknoodl: OK, can't seem to find the documentation for -s, and I've never used it before. Do you have any links to a guide on this sort of thing?
noodlremote: as a result, it's often helpful to deal with negative conditions first, using a kind of short circuit
tyroknoodl: I mean, I've looked over the VHost doc's, but I've never seen where it says you can't have multiple addresses.
noodl: I'm sure you're right, but I wouldn't know where to start looking.
noodltyrok: about a quarter of the docs are dedicated to explaining vhosts, sadly because they're overcomplicated
CraZyLeGs: if you've only got one vhost, all requests will use it. see:
main host goes away
fajitamain host goes away is http://httpd.apache.org/docs/2.2/vhosts/name-based.html#using (See note about "Main host goes away")
tyrokSounds like CraZyLeGs and I are having the same problem.
CraZyLeGsso should I create a vhost for localhost ?
noodlCraZyLeGs: you should create a default vhost, which is to say, one that's lexically first in your config. that way, any host names that aren't explicitly recognised will get caught
remoteif only i could use RewriteLog in htaccess :-/
CraZyLeGshmm ok
noodlCraZyLeGs: alternatively, you could create a vhost that's ServerAlias * and then put them in any order. point is, use the first match, or if there's none, use the first.
remote: yeah, that'd be great. there's a big technical issue with that though as the server would have to open() and lock() the file, per child, per request. that's nasty.
CraZyLeGsI have something like Include conf/sites/*.conf for vhosts so I dunno the order
remotei could really use log info
scotepican apache run on 2 ports? 80 and 84?
CraZyLeGsscotepi: yea
noodl: ok ServerAlias * works, thanks
scotepican google not index apache 2.0 docs properly? it seams when i search for apache stuff i alwase get 1.3 docs
noodlmaybe there's more links to those still floating around on the net? there's also the issue that http://httpd.apache.org/docs/foo/ redirects to httpd.apache.org/docs/foo/
um
http://httpd.apache.org/docs/foo/ redirects to http://httpd.apache.org/docs/1.3/foo/
it's that way because where there was only one branch of apache, the url was http://httpd.apache.org/docs/mods/mod_whatever.html and they didn't want to breal links.
remotemy .htaccess file is in my site root (public_html) and i'm wanting to rewrite any requests starting by /old-site-root/[...] to /[...]
i tried a few things.. oh and I have "RewriteBase /" at the beggining of my htaccess
tried "RewriteRule ^/old-site-root/(.*) /$1", "RewriteRule ^/old-site-root/?(.*) /$1", "RewriteRule ^/old-site-root(.*) $1" etc...
is it a regex problem?
scotepithink RewriteRule ^old-site-root/(.*) /$1
might need to escape the -.. \-
noodlno, that won't work. your htaccess file isn't consulted unless the request matches the directory
wait, sorry, i'm backwards
tyroknoodl: I think I'm on the right track now. Thank you!
noodlyou need RewriteRule ^old-site-dir/(.*) $1 (note the missing initial slash)
tyrok: good luck :)
tyroknoodl: Thanks - looks like I'll need about as much as I can get. :)
noodlremote: ^^ but also note that you'll need a RewriteCond %{REQUEST_URI} !^old-site-dir before it to avoid looping requests for that directory

Page: 2 9 16 23 

IrcArchive