Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Redirecting articles php pages


gladbee

Recommended Posts

Hi,

 

I'm wanting to 301 redirect some articles pages on an oscommerce install to newly created static html pages.

 

Oscommerce has been moved to a subdomain and the html pages are not linked in anyway to it.

 

I've tried lots of different ways in the .htaccess file but none of them work (either they don't redirect [404 error] or they are all redirected to one html page.)

 

For example,

 

I want to redirect this page: domain.com/article_info.php?articles_id=4 to domain.com/page.html

 

and: domain.com/article_info.php?articles_id=27 to domain.com/page17.html

 

 

Does anyone have any idea how to do this or a link to another thread outlining it. (I searched all of yesterday looking for the info on here, other forums, and G.)

Link to comment
Share on other sites

That's not a good idea since you will create problems with the session ID and lose the ability to easily edit the articles. But, if you are still want to do it, use a redirect in the .htaccess file of the shop. There are many examples on the web for how to do this.

Support Links:

For Hire: Contact me for anything you need help with for your shop: upgrading, hosting, repairs, code written, etc.

All of My Addons

Get the latest versions of my addons

Recommended SEO Addons

Link to comment
Share on other sites

That's not a good idea since you will create problems with the session ID and lose the ability to easily edit the articles. But, if you are still want to do it, use a redirect in the .htaccess file of the shop. There are many examples on the web for how to do this.

 

Thanks, Jack.

 

For anyone looking to know how to so it, this is the code that seems to be working for me:

 

RewriteEngine On

RewriteCond %{THE_REQUEST} \?

RewriteCond %{QUERY_STRING} (^|&)articles_id=11(&|$)

RewriteRule ^article_info\.php$ http://www.domain.com/page.html[R=301,L]

 

Obviously, you need to change the articles number, the domain name and the page name, but other than that this works. [got it from webmasterworld: http://www.webmasterworld.com/apache/4564161.htm ]

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...