URLS and .htaccess
Posted: Thu Sep 03, 2009 9:37 pm
Hi there PHP folk!
I'm an aspiring web developer and I have a question regarding urls and .htaccess. I'm working as a teacher at the moment but I want to get into development.
Here's the deal:
I want my hyperlinks to work like this:- href="domain.poo/page/"
but I want my server to see this:- "domain.poo/index.php?page=page"
And I want the URL to display the address bar like this (clients to see this):- "domain.poo/page/"
So correct me if I'm wrong (and please try to spell it out for me, I'm quite slow at times) but here's my current understanding:
- For optimising SEO: having URLS like 'domain.poo/page/?opt=value&etc=etc' is generally better!
- But if I'm picking up everything through my index page, it needs to be seeing 'index.php?page=page' to my server or my server needs to change it to this before my php scripts look at it... right?
As far as I understand, .htaccess can easily change a 'domain.com/index.php?page=page' to display as 'domain.com/page/'... but I for some reason REALLY want my hrefs to use the same formatting as that which the address bar displays...... so is it even possible to go from '.poo/page/' to '.poo/index.php?p=page' and then back to '.poo/page' for the users display and is there actually a SEO advantage to my preference or am I imagining things? Lol..
Thanks a heap and yes I realise this is probably the wrong forum for this question, I just have no idea which one it should go in >_<
- Lump
I'm an aspiring web developer and I have a question regarding urls and .htaccess. I'm working as a teacher at the moment but I want to get into development.
Here's the deal:
I want my hyperlinks to work like this:- href="domain.poo/page/"
but I want my server to see this:- "domain.poo/index.php?page=page"
And I want the URL to display the address bar like this (clients to see this):- "domain.poo/page/"
So correct me if I'm wrong (and please try to spell it out for me, I'm quite slow at times) but here's my current understanding:
- For optimising SEO: having URLS like 'domain.poo/page/?opt=value&etc=etc' is generally better!
- But if I'm picking up everything through my index page, it needs to be seeing 'index.php?page=page' to my server or my server needs to change it to this before my php scripts look at it... right?
As far as I understand, .htaccess can easily change a 'domain.com/index.php?page=page' to display as 'domain.com/page/'... but I for some reason REALLY want my hrefs to use the same formatting as that which the address bar displays...... so is it even possible to go from '.poo/page/' to '.poo/index.php?p=page' and then back to '.poo/page' for the users display and is there actually a SEO advantage to my preference or am I imagining things? Lol..
Thanks a heap and yes I realise this is probably the wrong forum for this question, I just have no idea which one it should go in >_<
- Lump