Forum Moderators: phranque
It seems to me that the handler would intercept the request and issue a request for the new url. Since it issues a request for the new url, a 301 at the old url would never be reached.
Is this correct?
You can implement an exrernal 301 redirect using mod_rewrite or mod_alias.
In addition, mod_rewrite can do an internal rewrite to 'map' a URL to a different server filepath than that which would normally be asociated with the request. This is entirely different from an external redirect, as the client is not involved.
If the server is configured to externally redirect a URL, and a request is received for that URL, then the server sends a redirect response header, providing the client with the new URL.
The only agent that issues HTTP requests is the client -- the browser or search engine robot for example. The server only responds to these client requests (like a good restaurant waiter).
So it is up to the client to re-request the desired resource from the new URL given in the preceding redirect response.
Jim
In addition, mod_rewrite can do an internal rewrite to 'map' a URL to a different server filepath than that which would normally be asociated with the request. This is entirely different from an external redirect, as the client is not involved.
Thats what I mean, if "...mod_rewrite can do an internal rewrite to 'map' a URL to a different server filepath than that which would normally be asociated with the request," ...the old url would not be fetched. If the old url is not fetched, any php 301 on it also would not be fetched.
right?