Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Seach Engine Friendly URL Support


BlueYon

Recommended Posts

Hi there,

 

hope that anyone can help me:

 

After having installed, I can neither enter the shop nor the admin area because of a 403 Error: Forbidden.

 

I am sure that this is a htaccess related problem, but I don't know how to fix it. When I delete it, I can enter the shop and the SEO works i. e. when choosing a category, its name appears in the link, but it cannot be found.

 

I use the original .htaccess which is:

 

RewriteEngine on

 

RewriteCond %{REQUEST_FILENAME} !-f

RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule ^(.*) index.php

 

For my Webspace, I have confixx where I can enter access rights to the folders, and I use it. Do these two things interfere? How can I fix it?

 

Any help will be appreciated! Thx in advance!

Link to comment
Share on other sites

  • Replies 968
  • Created
  • Last Reply

Top Posters In This Topic

Thanks for the great contribution! I have installed it and it works great!

 

I have a question - how can I achieve a short URL for a search? Right now when a search with keyword "bird"

is made, the URL is:

 

/advanced_search_result.php?search_in_description=1&keywords=birdx=12&y=3

 

I need it to be:

 

/bird-somethingelse.html

 

Can you please help me?

Link to comment
Share on other sites

Hi,

 

Hopefully somebody can help me with this problem i am getting parse erro on line 69 which is $url_rewrite = new url_rewrite; which i have added.

 

I have double checked i have done everything to the letter but still i recieve the error message.. could somebody please give me a clue what im missing.

 

 

Kind regards

Link to comment
Share on other sites

I just started using Google Sitemap and one of the problems I have ran into is that Google requires a 404 error page. Using the SEO contrib, the .htaccess file won't allow for this as any URL that doesn't exist in the filesystem gets rewritten as index.php. Is there a possible fix for this so that I can still have SEO URLs and keep a 404 error page for pages that don't exist?

 

The only possible solution I can think of is to have index.php check to see if the user is trying to go to a category/product and if so, redirect them to that product. Otherwise, if they seem to be accessing a file, check for its existence and then somehow redirect them to a 404 if it's not valid. Is there even a php function that will do a real 404 redirect that WONT return a status of 200?

 

Any help would be greatly appreciated!

 

Thank you!

Link to comment
Share on other sites

I just started using Google Sitemap and one of the problems I have ran into is that Google requires a 404 error page. Using the SEO contrib, the .htaccess file won't allow for this as any URL that doesn't exist in the filesystem gets rewritten as index.php. Is there a possible fix for this so that I can still have SEO URLs and keep a 404 error page for pages that don't exist?

 

The only possible solution I can think of is to have index.php check to see if the user is trying to go to a category/product and if so, redirect them to that product. Otherwise, if they seem to be accessing a file, check for its existence and then somehow redirect them to a 404 if it's not valid. Is there even a php function that will do a real 404 redirect that WONT return a status of 200?

 

Any help would be greatly appreciated!

 

Thank you!

 

I seemed to figure out a temporary fix for this if anyone else needs it.

// INDEX.PHP
if (!isset($HTTP_GET_VARS['products_id']) && (!isset($cPath) && !tep_not_null($cPath))){
$filename = $_SERVER['REQUEST_URI'];
if ($filename == "/") $filename = basename($_SERVER['PHP_SELF']);

if (!file_exists($filename)) {
	require('includes/404.php');
	exit;
}
}

// INCLUDES/404.PHP
<?
header("HTTP/1.0 404 Not Found");
header("Status: 404 Not Found");

echo "File Not Found";
?>

Link to comment
Share on other sites

d7a7z7e7d,

Sorry I don't have an answer for you, but I was wondering if you could tell me which Google Sitemaps contrib that you used with this Search Engine Friendly URL contrib, and is it working fine now with your solution?

Thanks!

 

 

 

Also, to the author of this contrib and anyone else that can help:

 

I have a question that I'm hoping someone can help me with - I've installed it along with the Meta Tag Controller Support (written by the same person) here:

http://www.tourdelaramie.com

 

For some reason, the left navigation category links do not include the "www" in the link (ex. http://tourdelaramie.com/DVD-Movies/).

 

I've checked my includes/configure.php file, and it seems to be set correctly:

 

define('HTTP_SERVER', 'http://www.tourdelaramie.com'); // eg, http://localhost - should not be empty for productive servers

define('HTTPS_SERVER', 'https://www.tourdelaramie.com'); // eg, https://localhost - should not be empty for productive servers

define('ENABLE_SSL', false); // secure webserver for checkout procedure?

define('HTTP_COOKIE_DOMAIN', 'www.tourdelaramie.com');

define('HTTPS_COOKIE_DOMAIN', 'www.tourdelaramie.com');

 

Product links, however, do include the "www" - example: http://www.tourdelaramie.com/Unreal-Tournament/ - and if I visit a product page and then go back to the left nav category links, they do have the "www" in the URL.

 

Take a look if you have a minute - any help in resolving this problem is greatly appreciated!

Edited by me23
Link to comment
Share on other sites

I seemed to figure out a temporary fix for this if anyone else needs it.

// INDEX.PHP
if (!isset($HTTP_GET_VARS['products_id']) && (!isset($cPath) && !tep_not_null($cPath))){
$filename = $_SERVER['REQUEST_URI'];
if ($filename == "/") $filename = basename($_SERVER['PHP_SELF']);

if (!file_exists($filename)) {
	require('includes/404.php');
	exit;
}
}

// INCLUDES/404.PHP
<?
header("HTTP/1.0 404 Not Found");
header("Status: 404 Not Found");

echo "File Not Found";
?>

 

 

Thanks man

Are you using BTS version of index.php ?

 

Regards

Hilton

Link to comment
Share on other sites

Hi there,

 

hope that anyone can help me:

 

After having installed, I can neither enter the shop nor the admin area because of a 403 Error: Forbidden.

 

I am sure that this is a htaccess related problem, but I don't know how to fix it. When I delete it, I can enter the shop and the SEO works i. e. when choosing a category, its name appears in the link, but it cannot be found.

 

I use the original .htaccess which is:

 

RewriteEngine on

 

RewriteCond %{REQUEST_FILENAME} !-f

RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule ^(.*) index.php

 

For my Webspace, I have confixx where I can enter access rights to the folders, and I use it. Do these two things interfere? How can I fix it?

 

Any help will be appreciated! Thx in advance!

 

PS: I use this contrib for a German shop and have edited the index.php in includes/languages/german instead of .../english Can my problems be related to that?

Link to comment
Share on other sites

Hi BlueYon

 

I just started using Google Sitemap and one of the problems I have ran into is that Google requires a 404 error page. Using the SEO contrib, the .htaccess file won't allow for this as any URL that doesn't exist in the filesystem gets rewritten as index.php. Is there a possible fix for this so that I can still have SEO URLs and keep a 404 error page for pages that don't exist?

 

The only possible solution I can think of is to have index.php check to see if the user is trying to go to a category/product and if so, redirect them to that product. Otherwise, if they seem to be accessing a file, check for its existence and then somehow redirect them to a 404 if it's not valid. Is there even a php function that will do a real 404 redirect that WONT return a status of 200?

 

Any help would be greatly appreciated!

 

Thank you!

 

I do have same problem.I am using BTS

 

Can you Please Help

Hilton

Link to comment
Share on other sites

Hi BlueYon

 

I just started using Google Sitemap and one of the problems I have ran into is that Google requires a 404 error page. Using the SEO contrib, the .htaccess file won't allow for this as any URL that doesn't exist in the filesystem gets rewritten as index.php. Is there a possible fix for this so that I can still have SEO URLs and keep a 404 error page for pages that don't exist?

 

The only possible solution I can think of is to have index.php check to see if the user is trying to go to a category/product and if so, redirect them to that product. Otherwise, if they seem to be accessing a file, check for its existence and then somehow redirect them to a 404 if it's not valid. Is there even a php function that will do a real 404 redirect that WONT return a status of 200?

 

Any help would be greatly appreciated!

 

Thank you!

 

I do have same problem.I am using BTS

 

Can you Please Help

Hilton

 

Hi,

 

I have this working fine with Google site maps. Yes there is a fix.

 

I have found oscommerce does not work very well with search engines. A lot of the search engines are now giving a duplicate content penalty in the rankings.

 

This means over time as you get a product, category or review not found when removing products you are no longer selling you can get hit with a penalty. Also with having the sort by product name or price this also causes the duplicate content penalty.

 

The same can be said for my contribution. When a URL can not be found it gets redirected to the front page.

 

The best method would be to go though the list of cached URL's before anything else loads and give a header("HTTP/1.0 404 Not Found"); if the URL?s can not be found.

 

You can use this tool to find out what headers your site is showing:

 

http://www.rexswain.com/httpview.html

Edited by Johnson
Link to comment
Share on other sites

I have installed this contribution on my local test server, and it is working wonderfully. However, something strange is happening on my production server. It appears that all of the urls are being correctly rewritten and processed, except those that are posted from a form. Two examples are the "add to cart" and "log in" forms. When I attempt to log in or add something to the cart, I get a "404 Not Found" error. Again, it appears that the urls from these two forms are not being rewritten, because when I receive the 404 error, the urls look like "https://www.mysite.com/login.php/action/process" or "http://www.mysite.com/index.php/cPath/31/products_id/46/action/add_slave". I am using the Master Products contribution, but because everything is working perfectly on my test server, and I have the exact same files on both servers (except for the configure.php files), I don't believe the problems lies with my code.

 

As this appears to be a server problem, the first thing I did was examine my server configuration files, but I couldn't find any discrepancies. If it helps, here is some additional information: I am running Apache 2.0.54 on my test server and Apache 2.0.40 on my production server; the "LoadModule rewrite_module modules/mod_rewrite.so" line is uncommented in both configuration files; "AllowOverride" is enabled in both directories; and the .htaccess file included with the contribution is placed in the public root of both servers (where both stores reside). I don't think it should matter, but while I have PHP 4.3.11 installed on my test server, I only have version 4.2.2 installed on the production server. Is there a difference in how mod_rewrite works on Windows vs. Unix that could be causing this? I know mod_rewrite is functioning on both servers, so I can't understand why, when the .htaccess file is instructing the server to rewrite all non-existing files or directories to index.php, these urls are not being rewritten. The file obviously doesn't exist, so why is it still looking for it instead of rewriting it to the index?

 

I was up all last night trying to solve this problem without any success. If anyone has a solution, or even an idea, I would greatly appreciate some help.

Link to comment
Share on other sites

I am trying to install this, but keep getting an error on the index.php page. Error: Parse error unexpected T_elseif ...index.php. I have worked for days trying to find the problem. When I take out the SEF, the index.php works fine.

 

Can someone please look at my file and try to see the problem? I don't want to post it here since it is so long. I will email it to you.

 

Thanks so much

Link to comment
Share on other sites

d7a7z7e7d,

Sorry I don't have an answer for you, but I was wondering if you could tell me which Google Sitemaps contrib that you used with this Search Engine Friendly URL contrib, and is it working fine now with your solution?

Thanks!

I am using Google XML Sitemap w/ Admin

http://www.oscommerce.com/community/contributions,3439

 

 

Thanks man

Are you using BTS version of index.php ?

 

Regards

Hilton

No. I'm not using any template system. My "fix" should work so long as you put the index code near the top of the file (i.e. right after requiring application_top.php).

Link to comment
Share on other sites

I am using Google XML Sitemap w/ Admin

http://www.oscommerce.com/community/contributions,3439

No. I'm not using any template system. My "fix" should work so long as you put the index code near the top of the file (i.e. right after requiring application_top.php).

 

Using http://www.rexswain.com/httpview.html status I receive for your fix is as below

 

HTTP/1.1�200�OK(CR)(LF)

Date:�Tue,�22�Nov�2005�17:57:38�GMT(CR)(LF)

Server:�Apache/2.0.54�(Win32)�PHP/4.4.0(CR)(LF)

X-Powered-By:�PHP/4.4.0(CR)(LF)

 

Any Idea ?

 

Hilton

 

 

 

Hi

as you have said

"Hi,

 

I have this working fine with Google site maps. Yes there is a fix."

But where is the fix ?

Can you help me please

Hilton

Edited by Johnson
Link to comment
Share on other sites

Using http://www.rexswain.com/httpview.html status I receive for your fix is as below

 

HTTP/1.1�200�OK(CR)(LF)

Date:�Tue,�22�Nov�2005�17:57:38�GMT(CR)(LF)

Server:�Apache/2.0.54�(Win32)�PHP/4.4.0(CR)(LF)

X-Powered-By:�PHP/4.4.0(CR)(LF)

 

Any Idea ?

 

Are you creating a separate file called "404.php" and putting it in your catalog/includes directory?

 

Ok, here is a STEP BY STEP TO FIX THE GOOGLE SITEMAP 404 ERROR PROBLEM:

 

1) Open: catalog/index.php

 

Near the very top of the file, find around line 13:

 

require('includes/application_top.php');

 

Put the following code immediate AFTER the above code:

 

//START OF 404
if (isset($HTTP_GET_VARS['products_id']) || (isset($cPath) && tep_not_null($cPath))) {
// Attempting to access product or category. Do not redirect to 404.
} else {
$filename = $_SERVER['REQUEST_URI'];
if ($filename == "/") $filename = basename($_SERVER['PHP_SELF']);

if (!file_exists($filename)) {
	// Attempting to access a file that we could not find.
	require('includes/404.php');
	exit;
}
}
//END OF 404

 

2) Create a new file: catalog/includes/404.php

 

Put the following code inside of this file:

 

<?php
header("HTTP/1.0 404 Not Found");
header("Status: 404 Not Found");
?>
Code your custom 404 Error page output here...
<p>For example:
<hr>
<h1>404 Not Found</h1>
The file you requested could not be found.

 

3) Upload both files to the appropriate directory and try going to a URL that you know doesn't exist (i.e.: www.yourserver.com/asdofijsafoij).

 

If you do this correctly, you should now have a 404 error page that you can customize. When you go to the HTTP Viewer and type in www.yourserver.com/index.php you will get an HTTP Status of 200 OK, but when you type in www.yourserver.com/aosdijoiasdoijf you will get an HTTP Status of 404 NOT FOUND.

 

Hope this helps,

 

Doug

Link to comment
Share on other sites

>_<

 

after i installed this contribution my site website 10 times slower and then after i installed the latest nov 8th security fix it went 100 times slower. what can i do ??

 

thanks for your help.

 

Jim

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...