Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

I hope my message is not "out of topic"....

I would like to make "clean URLs" on my website....

Is it possible to make something like this:

orig. URL: /inde.php?mcat=1&subcat=2

clean (nice) URL: /tv/lcd/

where mcat(1)="tv" and subcat(2)="lcd"

Thanks for any help....


Re: .htaccess

mrozko wrote:
Quoted text here. Click to load it

Not directly. You can create a URL such as http://www.example.com/tv/lcd
but you will need to transform 'tv' to 1 and 'lcd' to 2 yourself. The
redirect will reformat the URL to
http://www.example.com/index.php?mcat=tv&subcat=lcd .

You can find an excellent introduction to clean URL's at [1].

[1] http://www.yourhtmlsource.com/sitemanagement/urlrewriting.html

Jensen Somers <http://jsomers.eu
Email: -http:// +jensen@

"Programming today is a race between software engineers striving to
build bigger and better idiot-proof programs, and the Universe trying to
produce bigger and better idiots. So far, the Universe is winning."
   - Rick Cook, The Wizardry Compiled

Re: .htaccess


thank you very much for your simple solution. I was looking for very
complicated and one-step solution using .htaccess, unfortunately....

Thanks again :)


Re: .htaccess


I have one more question:

is it possible to use "loop" in the .htaccess:

let's say $mcat[1]="tv", $mcat[1][1]="lcd", $mcat[1][2]="crt", $mcat[1]
[3]="accessories",... (it means it is 2D array)

I would like to do this:
/tv/lcd/ /index.php?mcat=1&subcat=1
/tv/crt/ /index.php?mcat=1&subcat=2
/tv/accessories/ /index.php?mcat=1&subcat=3

note: $mcat has 10 items (0,...,10) ---- for each item there are at
least 5 subitems...

must I type one line for one "combination" of items & subitems? or is
it possible to "loop" through this?

maybe this question is "stupid" and I have to recode my scripts....

please, can you give me any idea for doing this? what is your opinion
about this?

thank you very much, in advance, for your (maybe completely different)


Re: .htaccess

mrozko wrote:
Quoted text here. Click to load it

Yes, it's a bit off topic here, as it isn't a PHP question.

You will get much better answers from alt.apache.configuration.

Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.

Site Timeline