logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: URLs ending in / show 404 when exploring with google bot in
Author
goodlinks



Joined: 07 Nov 2012
Posts: 2
Location: Barcelona

PostPosted: Wed 07 Nov '12 18:49    Post subject: URLs ending in / show 404 when exploring with google bot in Reply with quote

Hi, I have a WP online shop using WP E-commerce plugin 3.8.9 together with the SEO Yoast plugin.

My problem in that when exploring the product URLs ending with / in google webmaster tools, it displays 404. But the same URL without / is found and ok. I must day that both URLs show up correctly in browsers and the non / version is redirected to the one ending in /.

Here is my .htaccess:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

Perhaps I could solve this problem by setting a redirect to non / URLs instead. What do you think? Thanks in advance.
Back to top
cbj4074



Joined: 02 Nov 2012
Posts: 24
Location: United States

PostPosted: Wed 07 Nov '12 20:56    Post subject: Reply with quote

I know only enough about WordPress not to use it, and I know nothing about those two plug-ins, but this is a classic problem with any Web-server.

Technically speaking, /test and /test/ are completely different and unrelated URLs, so, unless you redirect one version to the other, the behavior that you're observing is expected.

Quote:
I must day that both URLs show up correctly in browsers and the non / version is redirected to the one ending in /.


This surprises me, given that browsing the URLs with Google Webmaster Tools yields 404 responses. I would expect either method of accessing the URLs to return the same HTTP response code.

The .htaccess file that you posted does nothing to or with the trailing-slashes. But, yes, if the plug-in(s) you're using don't provide a mechanism for dealing with this common conundrum, then it is possible to remove the trailing-slash using mod_rewrite via .htaccess.
Back to top
goodlinks



Joined: 07 Nov 2012
Posts: 2
Location: Barcelona

PostPosted: Thu 08 Nov '12 3:14    Post subject: Reply with quote

cbj4074 wrote:
I know only enough about WordPress not to use it


I'm beginning to realize it too.


cbj4074 wrote:

This surprises me, given that browsing the URLs with Google Webmaster Tools yields 404 responses. I would expect either method of accessing the URLs to return the same HTTP response code.

It's pretty weard. I have doing some testing with urivalet.com and it displays all URLs ok, none of them 404. However with other bots, like web-site-map.com, it shows 404 just like google does.

cbj4074 wrote:

The .htaccess file that you posted does nothing to or with the trailing-slashes. But, yes, if the plug-in(s) you're using don't provide a mechanism for dealing with this common conundrum, then it is possible to remove the trailing-slash using mod_rewrite via .htaccess.

I have no idea how does this plugin work or where is it making the redirect and adding the /. I have already tryied to remove the trailing-slash with mod_rewrite but it's giving all sorts of errors: infinite redirect loops, and other conflicts, probably because of this plugin.

So I found out that this plugin might be the problem. I will just try other plugins untill I learn some code and go back to HTML5 + php. Thanks.
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7355
Location: Germany, Next to Hamburg

PostPosted: Thu 08 Nov '12 11:17    Post subject: Reply with quote

I use a plugin called "Redirection" with a regular expression to prevent that.
Back to top


Reply to topic   Topic: URLs ending in / show 404 when exploring with google bot in View previous topic :: View next topic
Post new topic   Forum Index -> Apache