Forum Moderators: phranque
I'm currently reaching all the problems u are discussing a lot in those forums about apache and mod_rewrite and more generally making SE friendly sites...
I've succeeded compiling and setting mod_rewrite with my APACHE, and it rewrites well an URL like:
1/ [mydomain.com...]
into
2/ [mydomain.com...]
my PROBLEM is the following:
how should i CODE my HTML? have i to think writing url like #2? It's a bit hard to maintain!
Or is there a wway to rewrite html inline url dynamicaly?
Thx in advance, and btw great forums
Welcome to WebmasterWorld [webmasterworld.com]!
The purpose of URL rewriting in cases like this is to present "friendly" URLs to search engine spiders. Therefore, your HTML pages and any scripts you use should output "friendly" URLs. Mod_rewrite is then used to convert those friendly URLs, when requested by a browser or spider, back into the form required by your scripts.
The critical thing to undestand is *when* mod_rewrite executes. It runs after an incoming HTTP request is received, and before any file content is served. Once the content is served, mod_rewrite will not run again until the next HTTP request is received.
Therefore mod_rewrite cannot change the "output" of an HTML page or a script, it can only change the name by which that page or script is initially called.
See API Phases in the Internal Processing section of the mod_rewrite documentation [httpd.apache.org].
Jim