Convert Dynamic URL To Static URL

SEO forum is place for SEO specialists, analyst and expert to meet, ask, teach, interact and share ideas, information, tips and strategies on Search Engine Optimization.
Post Reply
john
Posts: 8
Joined: Mon Aug 09, 2010 11:27 am
Location: U.k
Contact:

Re: Convert Dynamic URL To Static URL

Post by john »

I am trying to convert my urls from this:

http://domain.com/cart.cgi?333

to this:

http://domain.com/333

where "333" is the item number of a product.

First I tried mod_rewrite:

RewriteRule ^cart/* cart.cgi?&$1

The page gets redirected and the browser url stays the same, but my cart.cgi script thinks that QUERY_STRING is empty.

So then I thought I'd just get the entire url using PATH_INFO and then parse it, but when I try my script thinks PATH_INFO is empty no matter what. If I turn off mod_rewrite and then type this into my browser:

[domain.com...]

my script prints the word "test" but not the url, using this code:

[red] $variable = $ENV{'PATH_INFO'};
print $variable;
print "test"; [/red]

Any ideas? Thank you very much for your help.
Post Reply