Forum Moderators: coopster

Message Too Old, No Replies

PHP and keyword url's

and what will it take to change it

         

chrisandsarah

12:25 pm on Oct 13, 2003 (gmt 0)

10+ Year Member



Hi
I have someone working on a database and scripts for me.
e.g
a user clicks on 'Attractions in cityname' and up pops a page containing all the cityname attractions we have listed in our database.

My questions are:
1. The url's his code produces are something like this:
www.mydomain.com/attractions/details.php?attractionID=43

I'd prefer them to be something like this:
www.mydomain.com/attractions/cityname_attraction_information.htm

with keywords in the url.
is it something that can be done easily enough before i go live with it?
i need to know if it can be done before i ask him

Many thanks,

[edited by: jatar_k at 5:35 pm (utc) on Oct. 13, 2003]
[edit reason] removed specifics [/edit]

gethan

1:57 pm on Oct 13, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



It could be done with either mod_rewrite or a custom script that is set as the handler for all urls ending with .html in that directory.

AddHandler [httpd.apache.org]
mod_rewrite [httpd.apache.org]

To do this quickly though your contractor/freelancer would need to be familiar with one or other of the techniques.

jamie

1:58 pm on Oct 13, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



hi chris or sarah,

yes it is possible. have a search in this forum (and google) for search engine friendly URLs. there are lots of posts about this sort of thing.

this article from sitepoint is an excellent starting point:

[sitepoint.com...]

good luck

ergophobe

4:24 pm on Oct 13, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Also, take a look at the links I previously posted in topic

[webmasterworld.com ]

Tom

chrisandsarah

4:45 pm on Oct 14, 2003 (gmt 0)

10+ Year Member



Ok thanks for all the advice. I sent the programmer who is doing my database work to this post and he is now saying he can get the urls something like this for me:
www.mydom.com/keyword/1-1-7-32/keyword/
with the number part of the url having to be there because he is using ID's.

That is better than the original /php?id=43 etc url but not perfect.

Another BIG problem i can see is, on my site at present i have reciprocal links boosting some pages, (mydom.com/desiredarea)and as my site is tourism related, it makes sense to have the file structure like it is now. e.g:
mydom.com/desiredarea, mydom/anotherarea,
So people know they can simply go to my domain, and if they want to learn about/see a place, they just type in that place name after the url and hit enter.

With what he is planning doing with the url's, there is no way i can keep the existing simple structure like this.

Is mod_rewrite the best way? and is it powerful enough to do this?(keep my existing file structure)

thanks for any help

ergophobe

5:27 pm on Oct 14, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



If he uses his database and mod_rewrite correctly, he can get the URLs to look any way he wants and does not need the IDs to actually show.

All of this will marginally increase server load, of course, but as the saying goes, hardware is cheap and the URL is part of the user interface. Look at the microsoft site - you cane type in www.microsoft.com/product_name/ for any product they have and that takes you there. And trust me, it's not a static site!

chrisandsarah

7:18 pm on Oct 14, 2003 (gmt 0)

10+ Year Member



Ok, one last question. Can the url manipulation/mod_rewrite stuff be sorted towards the end of the project before it goes live? or is this sort of thing something that needs sorting out from the offset

many thanks,

jatar_k

7:25 pm on Oct 14, 2003 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



I think the plan needs to be in place from the outset, structure/rewriting etc but the rewriting itself can be done whenever you like. You will need enough time, as with all projects, to manage any possible issues that may arise.

It will also depend on how familiar your programmer is with mod rewrite.