No error 500 this time though. I’m surprised that I don’t need the Options +FollowSymLinks bit but you’re right I am probably trying to run before I can walk with this.
Do you have any notion as to why the URL’s are the same?
Now I’m confused! Why does all the SEO stuff recommend using rewrite to change to URL’s into a friendly form for the SE’s? I understand that Apache does this internally but the optimised URL can be seen in the browsers address bar!? It sounds as though I’m missing something fundemental here.
The links you have on your website must be the “friendly” ones. Then mod-rewrite translates them, as the visitor clicks on them, to the ugly ones internally.
Visitor clicks on above link. mod-rewrite translates it to this ugly one internally:
/info.php?country=australia&state=victoria
In other words, mod-rewrite doesn’t translate your HTML on the fly from ugly to user-friendly. It does the opposite: translating the user-friendly to the ugly.
Thanks for the reply, but I can’t grasp what you just said:
The links you have on your website must be the “friendly” ones. Then mod-rewrite translates them, as the visitor clicks on them, to the ugly ones internally.
But it’s a dynamic site and ugly URL’s are the way it is. I can’t see how I can make friendly URL’s before mod_rewrite get’s at them. This is a naturally developed URL from the site:
However, if the visitor loads a URL like that, your web server wouldn’t know which script to pass it on to. mod-rewrite’s job is to tell your web server that if you see the URL like the above, then it really is http://www.mysite.co.uk/vehicle_detail.php?detailID=409, so send the request to /vehicle_detail.php with that query string.
In other words, you fix your scripts to print friendly URLs first. If it prints the ugly URLs then that’s all your visitors will see and there will be no rewrites.
Ok, I think I getting there. So I need to make the site print friendly URL’s and THEN get apache to rewrite them to the ugly form internally. Right, I see. I’m thinking I can make friendly URL’s with PHP PATH_INFO? Am I on the right lines here? Although it seems I may have a problem here as when I print_r($_SERVER[‘PATH_INFO’]) I get nothing!
Now you’ve got it! As the webmaster, YOU create the SEO links and the regex to turn them back into your physical (internal) links so Apache can serve the correct script.
Go have a read of my signature article - it should help you understand a little better.
Yep, I’ve got it now! I tried it out with one page on the clients site and it works great. There’s a lot of work to convert the whole site but everyone around here says it will reap rewards re: search engine listing etc.