phpBB SEO
Boards
Directory  
SEO  
Downloads
  phpBB SEO : Search Engine Optimization, Directory, Forums  
Index
Forums
Annuaire
Référencement
Télécharger
 
  Search Rechercher
    Register
Username :  Password :  Log me on automatically each visit  
S'enregistrer  
 
   
htaccess rewrite rule works but throws errors.

 
Post new topic   Reply to topic    phpBB SEO » SEO Forum  » Apache mod Rewrite
::  
Author Message
kidneybean



Joined: 15 Aug 2008
Posts: 3

htaccess rewrite rule works but throws errors.Posted: Fri Aug 15, 2008 7:08 pm    Post subject: htaccess rewrite rule works but throws errors.

From the perspective of someone visiting my site, the rewrite rule works fine, but meanwhile the server throws errors.

Here's the rule:

Code:
RewriteRule ^Other-Question/Ok-an-important-Olympic-Games-question/Q([a-zA-Z0-9]+)/F([0-9]+)$ Answers_Display.php?q=$1&format=$2


And here is the error:
Code:
www.myserver.com [Fri Aug 15 14:39:53 2008] [error] [client 70.23.83.149] File does not exist: /usr/www/users/moi/Stage/Other-Question, referer: http://myserver.com/Other-Question/Ok-an-important-Olympic-Games-question/Qv8bkjpqgjx/F5


Any clues?
Thanks.
Back to top
SeO
Administrateur - Site Admin
Administrateur - Site Admin


Joined: 15 Mar 2006
Posts: 3987

htaccess rewrite rule works but throws errors.Posted: Sat Aug 16, 2008 9:08 am    Post subject: Re: htaccess rewrite rule works but throws errors.

Interesting.
Have you checked if the server was now throwing a 404 header while it still displays the page ?

Anyway, you can try to add :

Code:
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d


Before the rewriterule, this should make so the server will first make sure that the file / dir does not exist before it will run it, and could fix the issue you're facing.

_________________
phpBB SEO || SEO Forum || Forum Référencement
GYM Sitemap & RSS for phpBB3 has been released ! || GYM Sitemap & RSS for phpBB3 est disponible !
Back to top
kidneybean



Joined: 15 Aug 2008
Posts: 3

htaccess rewrite rule works but throws errors.Posted: Mon Aug 18, 2008 5:48 pm    Post subject: still looking for clues!

Thanks, SeO.

The server doesn't throw a 404 header while it still displays the page.

I tried adding those two RewriteCond lines you suggested but I still get the same error.

Any other ideas? I'm desperate for things to try!

Thanks again.
Back to top
dcz
Administrateur - Site Admin
Administrateur - Site Admin


Joined: 28 Apr 2006
Posts: 15242

htaccess rewrite rule works but throws errors.Posted: Sat Aug 23, 2008 7:28 am    Post subject: Re: htaccess rewrite rule works but throws errors.

From the logs the error is on Other-Question/, a bot (they do such tests) or someone may just have tried to load what appears to be a dir, and fall on a genuine 404.

For this rewriterule only (could not work with other if any), you could redirect this type of calls to root like this :
Code:
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([a-z0-9]+/)?[a-z0-9]+/?$ / [L,NC,R=301]


++

_________________
Useful links :
SEO Forum || SEO Directory || SEO phpBB || SEO phpBB3 || Search
____________________

Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Référencement phpBB3 || Recherche
Back to top
Visit poster's website
kidneybean



Joined: 15 Aug 2008
Posts: 3

htaccess rewrite rule works but throws errors.Posted: Tue Sep 02, 2008 3:00 pm    Post subject: still searching for clues

Thanks, I tried adding

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([a-z0-9]+/)?[a-z0-9]+/?$ / [L,NC,R=301]

but I got the same error!
let me know if you can think of anything else to try.
thanks so much.
Back to top
dcz
Administrateur - Site Admin
Administrateur - Site Admin


Joined: 28 Apr 2006
Posts: 15242

htaccess rewrite rule works but throws errors.Posted: Sat Sep 06, 2008 8:41 am    Post subject: Re: htaccess rewrite rule works but throws errors.

Is it redirecting Other-Question/ to domain's root ?


You can as well try :
Code:
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^[a-z0-9]+(/[a-z0-9]+)?/?$ / [L,NC,R=301]


or event :

Code:
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^[a-z0-9]+(/[a-z0-9]+)?/?$ http://www.example.com/ [L,NC,R=301]


++

_________________
Useful links :
SEO Forum || SEO Directory || SEO phpBB || SEO phpBB3 || Search
____________________

Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Référencement phpBB3 || Recherche
Back to top
Visit poster's website
mnl-joshua



Joined: 29 Sep 2008
Posts: 1

htaccess rewrite rule works but throws errors.Posted: Mon Sep 29, 2008 4:08 pm    Post subject: Any resolution on this?

I have a very similar problem where pages render correctly to users, but google bot is receiving 404 for pages.. oddly, some rewrites work fine (and give 200).

Using web-sniffer, this url rewrite is fine:
http://web-sniffer.net/?url=http%3A%2F%2Fwww.meetnowlive.com%2Fvenues%2Fnew-york-area%2Fmanhattan%2F&submit=Submit&http=1.1&gzip=yes&type=GET&uak=7

This url rewrite throws 404:
http://web-sniffer.net/?url=http%3A%2F%2Fwww.meetnowlive.com%2Fvenue%2Fthe-town-tavern%2F&http=1.1&gzip=yes&type=GET&uak=7

htaccess has this..
RewriteRule ^venue$ /venue/
RewriteRule ^venue/([A-Za-z0-9-]+)(/*)$ /venue.php?v_slug=$1

RewriteRule ^venues$ /venues/
RewriteRule ^venues/$ /directory.php
RewriteRule ^venues/([A-Za-z0-9-]+)(/*)$ /directory.php?c_slug=$1

Any ideas why googlebot can't see?
Back to top
dcz
Administrateur - Site Admin
Administrateur - Site Admin


Joined: 28 Apr 2006
Posts: 15242

htaccess rewrite rule works but throws errors.Posted: Sat Oct 04, 2008 8:39 am    Post subject: Re: htaccess rewrite rule works but throws errors.

mm, I get a 200 on both examples.

You could still try to use :
Code:
RewriteRule ^venue(/([a-z0-9-]+))?/?$ /venue.php?v_slug=$2 [NC,L]
RewriteRule ^venues(/([a-z0-9-]+))?/?$ /directory.php?c_slug=$2 [NC,L]


Less rewriterules for the same usage, and more efficient with the L flag, which will prevent the eventual following rewriterules to be tested after one of these two matched.
NC flag stand for no case, and make the A-Z part useless in the character class.

++

_________________
Useful links :
SEO Forum || SEO Directory || SEO phpBB || SEO phpBB3 || Search
____________________

Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Référencement phpBB3 || Recherche
Back to top
Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    phpBB SEO » SEO Forum  » Apache mod Rewrite
Page 1 of 1

Navigation Similar Topics

Jump to: