| remote | i 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 ? |
| noodl | remote: no, conditions only ever apply to the next single rule |
| tyrok | noodl: 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? |
| noodl | remote: as a result, it's often helpful to deal with negative conditions first, using a kind of short circuit |
| tyrok | noodl: 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. |
| noodl | tyrok: 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 |
| fajita | main host goes away is http://httpd.apache.org/docs/2.2/vhosts/name-based.html#using (See note about "Main host goes away") |
| tyrok | Sounds like CraZyLeGs and I are having the same problem. |
| CraZyLeGs | so should I create a vhost for localhost ? |
| noodl | CraZyLeGs: 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 |
| remote | if only i could use RewriteLog in htaccess :-/ |
| CraZyLeGs | hmm ok |
| noodl | CraZyLeGs: 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. |
| CraZyLeGs | I have something like Include conf/sites/*.conf for vhosts so I dunno the order |
| remote | i could really use log info |
| scotepi | can apache run on 2 ports? 80 and 84? |
| CraZyLeGs | scotepi: yea noodl: ok ServerAlias * works, thanks |
| scotepi | can google not index apache 2.0 docs properly? it seams when i search for apache stuff i alwase get 1.3 docs |
| noodl | maybe 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. |
| remote | my .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? |
| scotepi | think RewriteRule ^old-site-root/(.*) /$1 might need to escape the -.. \- |
| noodl | no, that won't work. your htaccess file isn't consulted unless the request matches the directory wait, sorry, i'm backwards |
| tyrok | noodl: I think I'm on the right track now. Thank you! |
| noodl | you need RewriteRule ^old-site-dir/(.*) $1 (note the missing initial slash) tyrok: good luck :) |
| tyrok | noodl: Thanks - looks like I'll need about as much as I can get. :) |
| noodl | remote: ^^ but also note that you'll need a RewriteCond %{REQUEST_URI} !^old-site-dir before it to avoid looping requests for that directory |