Forum Moderators: phranque

Message Too Old, No Replies

Rewrite rule help needed please.

         

starpleasures

8:55 pm on Aug 4, 2007 (gmt 0)

10+ Year Member



I am using Oscommerce and the seo urls by chemo. I have installed the link manager 11 but can not get my urls for the link part of the site to go to the html pages. I am not sure how to incoporate the rewrite rules. Here are the rewrite rules I have now for the seo urls.

Options ExecCGI +FollowSymLinks
RewriteEngine On
RewriteBase /store/

RewriteRule ^(.*)-p-(.*).html$ product_info.php?products_id=$2&%{QUERY_STRING}
RewriteRule ^(.*)-c-(.*).html$ index.php?cPath=$2&%{QUERY_STRING}
RewriteRule ^(.*)-m-([0-9]+).html$ index.php?manufacturers_id=$2&%{QUERY_STRING}
RewriteRule ^(.*)-pi-([0-9]+).html$ popup_image.php?pID=$2&%{QUERY_STRING}
RewriteRule ^(.*)-t-([0-9]+).html$ articles.php?tPath=$2&%{QUERY_STRING}
RewriteRule ^(.*)-a-([0-9]+).html$ article_info.php?articles_id=$2&%{QUERY_STRING}
RewriteRule ^(.*)-pr-([0-9]+).html$ product_reviews.php?products_id=$2&%{QUERY_STRING}
RewriteRule ^(.*)-pri-([0-9]+).html$ product_reviews_info.php?products_id=$2&%{QUERY_STRING}
RewriteRule ^(.*)-i-([0-9]+).html$ information.php?info_id=$2&%{QUERY_STRING}

Now my links mod has links such as [mysite.com...]

can anyone help me with this so they also go to the html urls, or at least maybe the parentid thing gone to shorten the url?

PLease and thank you in advance.

g1smd

1:06 am on Aug 5, 2007 (gmt 0)

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



First off; are you trying to do redirects or rewrites?

They are similar but different things.

jdMorgan

1:30 am on Aug 5, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Internal rewrites are desired, undoubtedly.

The problem is that you need to get OScommerce --or its "SEF" plug-in-- to output the friendly URLs on your pages.

Once these friendly URLs appear on your pages, then the mod_rewrite code above will rewrite requests for those URLs to the OSC scripts in /store.

Jim

starpleasures

4:12 am on Aug 5, 2007 (gmt 0)

10+ Year Member



Thank you for answering me.

What I am wanting to do is make the links manager urls shorter, friendlier, html if possible like the seo by chemo does for the products and categories are for the rest of the site. I have searched for information on changing the links managers urls to friendlier ones but there is nothing.

Anything to get rid of the long url I have now. When you click a category now this is what you see.
[mysite.com...]

Im not really sure why the parentid was put into this mod. It never changes to anything else but parentid=0.

If just doing a rewrite rules would help im all for it. I just do not know how to do that. If its a modification of the link files, I am up for that as well. I just want to have all links search engine, and human friendly. At this point, I will do what ever it takes. Thank you again.

jdMorgan

2:40 pm on Aug 5, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



mod_rewrite cannot change the link published on your page -- That link is written by PHP or by PERL -- whichever language the OSC cart is written in, and is likely pulled from the database. It will require changes to the scripts to change those links if there is no module available to generate SEF URLs for the manager links.

*After* you make those on-page links shorter/friendlier, only then can mod_rewrite be used -- to change the shorter/friendlier links *back* to the long form that is needed to invoke OSC to generate the next page.

See this thread [webmasterworld.com] (and others) in our library.

Jim