osCommerce seo troubles

Need help installing PHP, configuring a script, or configuring a server? Then come on in and post your questions! We'll try to help the best we can!

Moderator: General Moderators

keithbyrne
Forum Newbie
Posts: 18
Joined: Thu Sep 20, 2007 5:20 am

osCommerce seo troubles

Post by keithbyrne »

Hey guys can u help me please, i have just installed a seo program within my website. its mean to turn my pages with this address :

http://oscommerce.local/catalog/index.p ... 960348b076

to this

http://oscommerce.local/catalog/belly-b ... -1_16.html

I have this in my .htaccess file

Code: Select all

Options +FollowSymLinks
RewriteEngine On
RewriteBase /catalog/

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}

Please help if you can my website has been down for over a month now and i dont know what to do !!!

Keith
[url=http://forums.devnetwork.net/viewtopic.php?t=30037]Forum Rules[/url] Section 1.1 wrote:2. Use descriptive subjects when you start a new thread. Vague titles such as "Help!", "Why?" are misleading and keep you from receiving an answer to your question.
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

Post by Benjamin »

You just installed it.. a month ago?

What's the error?
keithbyrne
Forum Newbie
Posts: 18
Joined: Thu Sep 20, 2007 5:20 am

Post by keithbyrne »

It was meant to rewrite my urls from php kinda styled ones to more search engine friendly ones now i just get a 404 error
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

Post by Benjamin »

What's the error?
keithbyrne
Forum Newbie
Posts: 18
Joined: Thu Sep 20, 2007 5:20 am

error

Post by keithbyrne »

The error is that the the url's are not being rewritten. when i click on any one of my products it gives me this error :

Object not found!

The requested URL was not found on this server. The link on the referring page seems to be wrong or outdated. Please inform the author of that page about the error.

If you think this is a server error, please contact the webmaster.
Error 404
oscommerce.local
10/19/07 13:57:21
Apache/2.2.4 (Win32) DAV/2 mod_ssl/2.2.4 OpenSSL/0.9.8d mod_autoindex_color PHP/5.2.1
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

Did you test this on a development server first or did you do this in production? Have you tested to make sure that mod_rewrite is actually working properly? What have you tried so far?
keithbyrne
Forum Newbie
Posts: 18
Joined: Thu Sep 20, 2007 5:20 am

Post by keithbyrne »

I had it working perfectly on my http://localhost/ and when i added in the contribution it didnt work. I'm sure its the rewrite thats not working properly
User avatar
Benjamin
Site Administrator
Posts: 6935
Joined: Sun May 19, 2002 10:24 pm

Post by Benjamin »

On the live site, are these pages in a folder called catalog?
keithbyrne
Forum Newbie
Posts: 18
Joined: Thu Sep 20, 2007 5:20 am

Post by keithbyrne »

I dont have the site online , this is my first website so i haven't bought and hosting or anything yet
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

So like astions asked, is your local site at http://localhost/catalog ?
keithbyrne
Forum Newbie
Posts: 18
Joined: Thu Sep 20, 2007 5:20 am

Post by keithbyrne »

yeah thats it exactly sorry
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

There are a couple of things you can do. One is to change the rewrite rule from index.php.... to catalog/index.php...

The other, which is what I do, is to make local virtual hosts on your local server. I do this because, quite honestly, I will rarely be working a site to be http://site.tld/mylocalfoldername so to keep things as close to in sync as possible, I create a local server called site.dev and build my development stuff in there.

If you are on an apache server you can easily turn on the NameVirtualHost property (usually to 127.0.0.1) then create a virtual host using the VirtualHost property. After you set it up, change your host file to make sure that the hostname you choose for the virtual host is pointed at 127.0.0.1 so everything works like it should.

Doing it this way makes your development effort locally almost identical to your production environment web server set up.
keithbyrne
Forum Newbie
Posts: 18
Joined: Thu Sep 20, 2007 5:20 am

Post by keithbyrne »

Yeah i have apache and i've 2 sites on my localhost. no.1 is on 127.0.0.1 or http://localhost/ which nothing to do with website building

but the one i'm designing and the one im having the problem with is on http://oscommerce.local/catalog/index.php
User avatar
RobertGonzalez
Site Administrator
Posts: 14293
Joined: Tue Sep 09, 2003 6:04 pm
Location: Fremont, CA, USA

Post by RobertGonzalez »

You are going to need to prepend the index.php (or whatever page is assigned as the handler) with catalog/ for this work. Try it and see if that works.
keithbyrne
Forum Newbie
Posts: 18
Joined: Thu Sep 20, 2007 5:20 am

Post by keithbyrne »

Tried that mate and no look any other ideas does my code look o.k ?

Code: Select all

# $Id: $
#
# This is used with Apache WebServers
#
# For this to work, you must include the parameter 'Options' to
# the AllowOverride configuration
#
# Example:
#
# <Directory "/usr/local/apache/htdocs">
#   AllowOverride Options
# </Directory>
#
# 'All' with also work. (This configuration is in the
# apache/conf/httpd.conf file)

# The following makes adjustments to the SSL protocol for Internet
# Explorer browsers

#<IfModule mod_setenvif.c>
#  <IfDefine SSL>
#    SetEnvIf User-Agent ".*MSIE.*" \
#             nokeepalive ssl-unclean-shutdown \
#             downgrade-1.0 force-response-1.0
#  </IfDefine>
#</IfModule>

# If Search Engine Friendly URLs do not work, try enabling the
# following Apache configuration parameter

# AcceptPathInfo On

# Fix certain PHP values
# (commented out by default to prevent errors occuring on certain
# servers)

# php_value session.use_trans_sid 0
# php_value register_globals 1

Options +FollowSymLinks
RewriteEngine On 
RewriteBase /catalog/

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}
Tnx Buddy
Post Reply