Forum Moderators: phranque

Message Too Old, No Replies

Nice URL's

         

MaticooL

11:40 am on Jun 24, 2006 (gmt 0)

10+ Year Member



Hello to all!

I was wondering, is there any way to convert ugly querystring like:

list.html?emu=gba&letter=A to list-gba-A.html or something like that

Thanks in advance!

vwsequeira

3:32 pm on Jun 24, 2006 (gmt 0)

10+ Year Member



May Jim will help you with Mod_rewrite

jatar_k

3:57 pm on Jun 24, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



try this library thread
Changing Dynamic URLs to Static URLs [webmasterworld.com]

MaticooL

5:48 pm on Jun 24, 2006 (gmt 0)

10+ Year Member



Did you read it yourself?

jatar_k

5:50 pm on Jun 24, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



yes I have

MaticooL

7:16 pm on Jun 24, 2006 (gmt 0)

10+ Year Member



Well, that didnt help me though!

jatar_k

7:33 pm on Jun 24, 2006 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



well, the way to convert query strings to nice urls is to use mod_rewrite

the only other way would be to change all the pages on your site, I don't think that is your best plan of action

there's this one too
Beginning Mod_Rewrite [webmasterworld.com]

or this
A Short Introduction and Guide to Apache Mod Rewrite [webmasterworld.com]

eeek

5:25 pm on Jun 26, 2006 (gmt 0)

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



well, the way to convert query strings to nice urls is to use mod_rewrite

You can also use positional arguments with PATH_INFO. In many cases it's a lot simpler than mod_rewrite.

jdMorgan

8:08 pm on Jun 26, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



well, the way to convert query strings to nice urls is to use mod_rewrite

the only other way would be to change all the pages on your site, I don't think that is your best plan of action


Actually, you need to do both. As explained in the thread cited above, you must change the links on your pages to 'static' format, and then use mod_rewrite to 'point' those URLs, when requested from your server, to the dynamic page generation script.

You have two choices on the request-processing approach; You can either use mod_rewrite to re-construct the entire query string, or you can point all requests to the script, and use PATH_INFO or other server variables to re-create the query-string-based script variables. This decision is primarily based on whether you wrote the script yourself and know how to modify it, or whether you are passing requests to a standard, purchased script.

The cited thread provides the answer to this question in detail. If you have specific questions, please post them. However, this is a discussion forum, not a 'help desk' and we cannot do the work for you, so study is recommended.

Jim