Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

[Contribution] Ultimate SEO URLs - by Chemo


Guest

Recommended Posts

It isn't the {QUERY_STRING} but probably some other setup consideration.  I have seen servers where you need to add:

Options +FollowSymLinks

above the RewriteEngine On directive whereas others don't.  Also, the htaccess file should a blank line (line feed) at the end of the file.

 

Do you happen to have different folders for SSL / NONSSL?

 

Bobby

 

I dont Bobby its all in catalog, it must be something I am doing wrong then if its not the code or the server?

 

# $Id: .htaccess,v 1.3 2003/06/12 10:53:20 hpdl Exp $
#
# 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>

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

#<IfModule mod_php4.c>
#  php_value session.use_trans_sid 0
#  php_value register_globals 1
#</IfModule>
Options +FollowSymLinks
RewriteEngine On 
# Change "folder" to your catalog directory name
RewriteBase /catalog/
RewriteRule ^(.*)-p-(.*).html$ product_info.php?products_id=$2&%{QUERY_STRING}
RewriteRule ^(.*)-c-(.*).html$ index.php?cPath=$2&%{QUERY_STRING}
RewriteRule ^(.*)-m-(.*).html$ index.php?manufacturers_id=$2&%{QUERY_STRING}

 

The server is running Linux 2.4.7 and the HTTP server info is Apache/1.3.29 (Unix) ApacheJServ/1.1.2 PHP/4.3.4 mod_throttle/2.11 FrontPage/5.0.2.2634 Rewrit/1.1a

Link to comment
Share on other sites

  • Replies 1.9k
  • Created
  • Last Reply

Top Posters In This Topic

Scott,

 

Try this:

 

Remove the htaccess file in your document root. Upload an index.php file with this as the contents:

<?php
$goto = "http://www.yourdomain.com/catalog/";
header("HTTP/1.0 301 Moved Permanently");
header ("Location: $goto");
?>

This will redirect to the catalog directory the same as with the htaccess redirect. Be sure to change the yourdomain.com to the actual web address.

 

Save the file to your document root.

 

Try the links in the catalog folder...

 

The purpose of this is to test your setup and eliminate one more variable. It may be that your server is having trouble with the multiple rewrites.

 

Bobby

Link to comment
Share on other sites

Scott,

 

Try this:

 

Remove the htaccess file in your document root.  Upload an index.php file with this as the contents:

<?php
$goto = "http://www.yourdomain.com/catalog/";
header("HTTP/1.0 301 Moved Permanently");
header ("Location: $goto");
?>

This will redirect to the catalog directory the same as with the htaccess redirect.  Be sure to change the yourdomain.com to the actual web address.

 

Save the file to your document root.

 

Try the links in the catalog folder...

 

The purpose of this is to test your setup and eliminate one more variable.  It may be that your server is having trouble with the multiple rewrites.

 

Bobby

 

Bobby thank you very much for you help on this matter, I have made the changes but it has not made any difference.

 

Server Error

Link to comment
Share on other sites

Bobby thank you very much for you help on this matter, I have made the changes but it has not made any difference.

 

Server Error

 

Messing around trying different things,its seems to be linked to something with the ssl?

 

Without the htaccess file modified I can view ANY page on my site on http or https.

If I modify the htaccss file I can still view any page on my site on http, but the server error message occures when I use https on any page!!

 

 

Does that help any? :D

Link to comment
Share on other sites

404 ERROR STUFF...

 

Hey Gang,

 

After a lot of help from Paul (fourbit) - Thanks, Paul - and a lot of hunting online, I was finally able to get it to work on my server here (which a Mac running OSX).

 

Here's what I have to report:

 

1) Make sure that you have the httpd.conf configured correctly to allow for AllowOveride set to All

 

2) If you're running your site on a Virtual Servers, make sure that the AllowOveride directive is set wtihin the correct Virtual Servers configuration, wherever that is on your server (probably httpd.conf)

 

3) Check out this MUST SEE link, which will help you understand how Mod Rewrite works - and hence, be able to both test to see if your mod_rewrite directive is working.

 

http://www.webmasterworld.com/forum92/82.htm

 

Awesome link. It actually helped me understand how Chemo's module worked. I followed the example with the absolute simplest example at the above link, which tested to show that the mod_rewrite directive was working.

 

4) Testing, after using the Mod_Rewrite example from the above link, helped show me through trial and error where the 404 was happening. Consequently, I was able to debug my .htaccess file.

 

My catalog is in the following directory: /Thoomp/catalog

 

And I determined that the following .htaccess file, which is in my root directory, actually works now:

 

Options +FollowSymLinks

RewriteEngine on

# Change "folder" to your catalog directory name

RewriteBase /

RewriteRule ^(.*)-p-(.*).html$ /Thoomp/catalog/product_info.php?products_id=$2&%{QUERY_STRING}

RewriteRule ^(.*)-c-(.*).html$ /Thoomp/catalog/index.php?cPath=$2&%{QUERY_STRING}

 

Note that I modified the two RewriteRules to add the prefix. For my particular configuration, this works - with the .htaccess in the root directory. Also, I also removed the .htaccess that was in the catalog directory.

 

Again, in the end, this had nothing to do with an HTML redirect file that takes the user to the landing page (/catalog/index.php).

 

Anyhow, thank you both Bobby and Paul for all your help! Hope all this helps everyone with 404 troubles.

 

- Seth <>

 

http://www.thoomp.com

Link to comment
Share on other sites

Hi,

I've just installed this contribution. I had some problems with server error500, caused because I had a pw on the server. I've removed the pw and no more errors :)

My problem is that I can't find the area in my admin section to switch the contrib on :) I've looked in every section, concentrating in the configuration section. Am I missing something or just going nuts? :-"

Link to comment
Share on other sites

Hi,

I've just installed this contribution. I had some problems with server error500, caused because I had a pw on the server. I've removed the pw and no more errors :)

My problem is that I can't find the area in my admin section to switch the contrib on :) I've looked in every section, concentrating in the configuration section. Am I missing something or just going nuts?  :-"

 

Yuck what is the pw?

Link to comment
Share on other sites

Yuck what is the pw?

 

I have no password anymore, it was on my URL as my site is not live yet. It was messing with the contribution so I removed it temporarily. If you or anyone can point me to where I enable SEO urls now the contrib is installed I will be able to sleep tonight :)

I think I have the PC monitor equivalent of snow blindness!

Edited by Yuck
Link to comment
Share on other sites

Hi. I have had this contrib installed for a few weeks now. The links look good but....

 

This link http://www.apexdog.com/34petflex-bandage-434-5yd34-p-28.html

 

looks like this in googles index

 

http://www.apexdog.com/34petflex-bandage-434-5yd34-p-28.html?name=%26%2334%3BPetFlex%20Bandage%204%26%2334%3B%20x%205yd%26%2334%3B

 

The page cache/snapshot date reported by google is Feb 6, 2005 22:03:49 GMT, so am I just seeing old info in the google index that will be replace with the SEO link over time, or is all the "?name=%26%2334%3BPetFlex%20Band...." garbage coming from somewhere else?

 

I also have a site map contib loaded & modified to work with the ultimate SEO URL contribution. Links look good there too.

Edited by apexdog
Link to comment
Share on other sites

mysite.com/speed2-cruise-controlp-18.html

 

using this sounds like it would get me out of a hole for integrating with a javascript drop down menu I've written, in that I can give absolute urls to the js menu links.

 

Possibly the one problem it would leave me with is being able to link to my cart, checkout etc from a .js drop down menu.

 

Would it be able to help there, or am i missing something about search engine friendly urls and session-id still working in the background?

Link to comment
Share on other sites

I have no password anymore, it was on my URL as my site is not live yet. It was messing with the contribution so I removed it temporarily. If you or anyone can point me to where I enable SEO urls now the contrib is installed I will be able to sleep tonight :)

I think I have the PC monitor equivalent of snow blindness!

 

It's at the bottom of the list in Admin/configuration

Link to comment
Share on other sites

It's at the bottom of the list in Admin/configuration

 

Hmm, my config menu looks like this:

 

Configuration

My Store

Minimum Values

Maximum Values

Images

Customer Details

Shipping/Packaging

Product Listing

Stock

Logging

Cache

E-Mail Options

Download

GZip Compression

Sessions

Dynamic MoPics

 

 

Thats a cut 'n paste.

Something must be wrong, If anyone has any clues I would appreciate it.

Thanks.

Link to comment
Share on other sites

OK,

Having dug around the files it looks like install-seo.php is the file responsible for getting the menu stuff installed. I ran this and install-cache.php but I guess something didn't happen the way it was supposed to. Can I run install-seo.php again, or do I need to start from the beginning and un-install first?

Thanks :)

Link to comment
Share on other sites

FOR THE LOVE OF ALL THINGS HOLY TOM JUST GIVE ME AN FTP ACCOUNT AND LET ME INSTALL IT FOR YOU!

 

:)

 

Seriously, I've never seen anyone try so hard with as much tenacity.  You deserve to have this installed on your site.  Setup a TEMPORARY FTP account for me and send me the credentials VIA email (not PM).  My private message box gets filled up about every 2 days so gets dumped often.

 

Bobby

 

I sent you the temp ftp details. Hope you got them ok.

 

Cheers!

 

Tommy

Link to comment
Share on other sites

OK,

Having dug around the files it looks like install-seo.php is the file responsible for getting the menu stuff installed. I ran this and install-cache.php but I guess something didn't happen the way it was supposed to. Can I run install-seo.php again, or do I need to start from the beginning and un-install first?

Thanks :)

 

Yea. that is the problem. You can run those files again. But, uninstall then install. At least that's my understanding. I'll check.

 

Paul

Link to comment
Share on other sites

Just looking at the URLs this contrib produces - in my opinion the adding of the c-xx and p-xx even tho it reduces resource cost reduces the seo value of the contrib as this useless data is just flak to a search engine spider and it might prevent it from spidering the url.

 

-ciaron

Link to comment
Share on other sites

Just looking at the URLs this contrib produces - in my opinion the adding of the c-xx and p-xx even tho it reduces resource cost reduces the seo value of the contrib as this useless data is just flak to a search engine spider and it might prevent it from spidering the url.

 

-ciaron

Can you back up your opinion with data?

 

Bobby

Link to comment
Share on other sites

i just know from general experience that the longer a url, and the more words in it the less importance se spiders are going to give the url and any keywords in the url.

 

-c

Which is why I put in a short word filter for the store owners to use. Regardless of how you slice this pie this method is infinitely better than the stock system. Is it perfect? Never claimed it was.

 

Bobby

Link to comment
Share on other sites

Hi

 

I installed ultimate seo urls 1.4. Everything went OK but now I get urls like this:

 

htp://localhost/shop/product_info.php?pName=speed&osCsid=7a9786a34ac2f234d67bcae37c758384

 

SIDs are still in the urls. :blink: Any ideas why?

 

I have STS and Header tags controller installed.

 

Oh, and one more Q: Is version 2.0 better than 1.4 performance-wise?

 

 

Thank you

Edited by gv
Link to comment
Share on other sites

Are there any server consideration you need to check before installing this?

I'm on a shared server and I'd like to check that I have anything (serverside) installed before I try this mod.

 

Hope thats clear

 

Thanks

 

Floob.

Link to comment
Share on other sites

Hey all! Yes, it's me again...

 

Chemo, originally you thought that my SEO software was not seeing the title, description, and keywords because there were line breaks in the description. I understand why search engines would ignore pages with line breaks, but I don't see how line breaks in the description would also cause the title and keywords not to come up. Regardless, I modified the page code and now there are no line breaks, but the software still does not see any of the meta data. Do you have any other suggestions?

 

Also, I tried the URL in your web based spider program. Just a couple days ago it would spit back some info about the page. Now it just sends my browser to that specific page/site. Did something change?

 

-Aaron

Link to comment
Share on other sites

My existing Google pages are coming up with a "Product not found" message.

 

The urls Goodle has spidered looks like this:

 

www.ukgoods.com/product_info.php/products_id/59

 

I gather something should be fixed in .htaccess but I am afeered of messing with it :)

 

Any ideas?

 

Also, I would like to that Bobby for all his work. This is a great contribution!!!!

 

Thanks,

 

Donna

Link to comment
Share on other sites

Hi

 

I installed ultimate seo urls 1.4. Everything went OK but now I get urls like this:

 

htp://localhost/shop/product_info.php?pName=speed&osCsid=7a9786a34ac2f234d67bcae37c758384

 

SIDs are still in the urls.  :blink:  Any ideas why?

 

I have STS and Header tags controller installed.

 

Oh, and one more Q: Is version 2.0 better than 1.4 performance-wise?

Thank you

You will get the osCsid appended on the first page load but on first click it should be pulled from the cookie. That is normal operation of a properly configured store.

 

Are there any server consideration you need to check before installing this?

I'm on a shared server and I'd like to check that I have anything (serverside) installed before I try this mod.

 

Hope thats clear

 

Thanks

 

Floob.

Yes...you need to make sure mod_rewrite is enabled on your server.

 

Hey all! Yes, it's me again...

 

Chemo, originally you thought that my SEO software was not seeing the title, description, and keywords because there were line breaks in the description. I understand why search engines would ignore pages with line breaks, but I don't see how line breaks in the description would also cause the title and keywords not to come up. Regardless, I modified the page code and now there are no line breaks, but the software still does not see any of the meta data. Do you have any other suggestions?

 

Also, I tried the URL in your web based spider program. Just a couple days ago it would spit back some info about the page. Now it just sends my browser to that specific page/site. Did something change?

 

-Aaron

Your issue is unique...what is causing it is still a mystery.

 

My existing Google pages are coming up with a "Product not found" message.

 

The urls Goodle has spidered looks like this:

 

www.ukgoods.com/product_info.php/products_id/59

 

I gather something should be fixed in .htaccess but I am afeered of messing with it :)

 

Any ideas?

 

Also, I would like to that Bobby for all his work.  This is a great contribution!!!!

 

Thanks,

 

Donna

I am working on an automatic 301 header redirect code block and should have it completed shortly. If you want a sneak peek here it is:

	if (SEO_URLS == 'true'){
 $request_uri = ltrim($_SERVER['REQUEST_URI'], '/');
 $name_query_str = basename($_SERVER['SCRIPT_NAME']) . '?' . $_SERVER['QUERY_STRING'];
 $path_info = ltrim(getenv('PATH_INFO'), '/');
 $url_array = parse_url(basename($_SERVER['SCRIPT_NAME']) . '?' . $_SERVER['QUERY_STRING']);
 
 $seo_page = ( ($url_array['path'] == FILENAME_DEFAULT || $url_array['path'] == FILENAME_PRODUCT_INFO) ? true : false );
 $cname = ( eregi("(cName|pName)", $request_uri) ? true : false );
 $mID = ( eregi("(manufacturer)", $request_uri) ? true : false );
 
 switch (true){
	 case ( !$seo_page ):
   break;
	 
	 case ( strlen($path_info) > 0 ):
   $tmp = explode('/', $path_info);
	 
   if ( sizeof($tmp) > 2 ){
  	 $container = array();
  	 for ($i=0, $n=sizeof($tmp); $i<$n; $i++) {
     $container[] = $tmp[$i] . '=' . $tmp[$i+1]; 
     $i++;
  	 }
  	 $params = implode('&', $container);
   } else {
  	 $params = implode('=', $tmp);
   }    
   echo $params;
   $url = tep_href_link($url_array['path'], $params);
   break;
	 
	 case ( ($request_uri == $name_query_str) && (!$cname) && (!$mID) ):    
   $url = tep_href_link($url_array['path'], $url_array['query']);
   break;
   
	 case ( $cname && SEO_URLS_TYPE != 'cName' ): 	 
   $params = array();
   if ( isset($HTTP_GET_VARS['cName']) && defined(urldecode($HTTP_GET_VARS['cName'])) ) {
  	 $params[] = constant(urldecode($HTTP_GET_VARS['cName']));
   }
   if (isset($HTTP_GET_VARS['pName']) && defined(urldecode($HTTP_GET_VARS['pName'])) ) {
  	 $params[] = constant(urldecode($HTTP_GET_VARS['pName']));
   }
   $params = implode('&', $params);
   $url = tep_href_link($url_array['path'], $params);
   break;    
 } # end swithch
 
 if ( tep_not_null($url) ) {
	 header("HTTP/1.0 301 Moved Permanently");
	 header ("Location: $url");
 }  
 
} #end if SEO_URLS

 

It should be noted that this is BETA code and I'm currently testing it on my dev server for every combination that I can think of. As it is most of the bugs have been worked out but I'm not done testing. You can install the code if you wish but I will release the final version when I'm done and it may or may not change.

 

Paste the code below the SEO URLs code in application_top.php

 

Bobby

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...