lucy24 - 8:25 pm on Mar 13, 2013 (gmt 0)
I have to changes something to redirect some webs to localhost instead of server.
Does "localhost" mean simply your own computer, or does it mean a pseudo-server such as WAMP? If WAMP (or MAMP or similar), do you have the basic version that only does one domain at a time, or the fancy version that comes with a fake DNS?
If a link includes the complete domain name, there is no way to intercept that. You can only intercept incoming links. UNLESS your setup includes the pseudo-DNS aspect.
Lines like this
127.0.0.1 - - [13/Mar/2013:15:02:26 +0100] "GET /fincamps/pisos-casas HTTP/1.1" 404 1279
together with your first post make it sound as if the real site does some rewriting. You need to have the identical rewrites in place on your offline test site.
127.0.0.1 - - [13/Mar/2013:15:02:26 +0100] "GET /favicon.ico HTTP/1.1" 404 1129
Well, that one's easy ;) Your browser is asking for the favicon-- as browsers always do-- and you probably didn't bother to put a copy on your offline site. May as well include one, just so the browser can stop asking for it. Otherwise it will make a fresh request on every single page load.
127.0.0.1 - - [13/Mar/2013:15:02:22 +0100] "GET /fincamps HTTP/1.1" 301 239
127.0.0.1 - - [13/Mar/2013:15:02:22 +0100] "GET /fincamps/ HTTP/1.1" 302 664
127.0.0.1 - - [13/Mar/2013:15:02:22 +0100] "GET /fincamps/es HTTP/1.1" 301 242
127.0.0.1 - - [13/Mar/2013:15:02:22 +0100] "GET /fincamps/es/ HTTP/1.1" 200 18737
is an absolutely horrendous pattern. Is this the kind of thing you were called in to fix?
/fincamps 301 to /fincamps/ is legitimate IF the original request was a type-in AND "fincamps" is a real, physical directory. If both of those things are true, it is simply mod_dir doing its job. BUT if either of those things is not true, there is a problem.
/fincamps/ 302 to /fincamps/es followed by 301 to /fincamps/es/ cannot possibly be right. The first redirect is presumably triggered by something in the code that either detects system language or reads a cookie. But it should go straight to /es/ whether or not that is a real, physical directory.