|Does mod_rewrite automatically change URLs?|
Should i be hardcoding rewritten URLs?
hey guys im trying to make a dynamic URL static and ive got it to the point where i can goto make the following URL:
translate into this:
My question is now that i have that finished, do i have to Hard code all links to be domain.com/var_name/var/ instead of the dynamic URL, or does mod_rewrite do this automatically?
Its currently not doing it automatically, so im not sure what is happening.
If the whole thing is about hiding the variables from the browser address line and the SE spiders, then you would only use this for your scripts:
- and use this in links and everywhere else:
mod_rewrite can make sure that the server "sees" no 1 when no 2 is entered in the browser, so that when asking for no 2, a visitor will get no 1 delivered (or the other way round).
I think you may have done it the other way round, so that no. 1 entered in the address line will be no. 2 on the server, and then your scripts will not work, but it's easy to fix, just reverse it :)
claus, thank you for responding, but im a little confused.
You are absolutely, right. I want SEs to be able to spider my links, i run a link site (almos like dmoz, but on a super small scale and only targeting a specfic type of site) but each catagory of links a diff variable call to a php script.
Are you saying that i have to Hard code all static links into my scripts?
I was under the impressions that by setting mod_rewrite to rewrite the URL, links on the pages are automatically changed from the dynamic URL that used to be displayed, to a static URL when viewed/spidered.
|Are you saying that i have to Hard code all static links into my scripts? |
|I was under the impressions that by setting mod_rewrite to rewrite the URL, links on the pages are automatically changed from the dynamic URL that used to be displayed, to a static URL when viewed/spidered. |
You have it backwards. The mod_rewrite takes a static looking url, peels off the variables, and converts it back to a dynamic url before the script executes it. So, you need to hardcode the static links not the dynamic ones.