Check 301 before installing

Zero duplicate support forum.
Personalized HTTP 301 dynamic redirections.

Moderator: Moderators

Check 301 before installing

Postby euroman » Wed Jan 24, 2007 3:22 pm

If this is not enough to have your server return the correct headers, I'm afraid to tell you you should consider
changing ;-)


Is there a way to check if the server is up for the job before installing the zerodub?
euroman
PR0
PR0
 
Posts: 81
Joined: Sat Oct 21, 2006 10:18 pm

Advertisement

Postby dcz » Wed Jan 24, 2007 3:54 pm

Well, yes, it's possible, but the easiest and most secure way to check is to check the actual code.

It could be a good idea to add a special file to perform these test in the install, will think about it.

By this time, you can for example just implement the phpbb_seo_class.php code changes, and just mod index.php for example.

Then, you'd be able to check the redirections, testing a false title in a category URL, something like :
example.com/this-is-not-the-correct-title-cxx.html

With xx being a real cat id in your phpBB install.

Chances are very little that wrong header would be returned, but it's a very important matter.
So that's why we have preferred to warn our member about how important it is to make sure about the headers.
In general, these tests will be positive, in few cases, the .htaccess code changes will be necessary, I have never seen an example where it would not be enough so far, but, who knows.
It just mandatory to check, that's all, not because the code is not stable, but because of some server config exceptions.

++
Useful links :
SEO Forum || SEO Directory || SEO phpBB || Search
____________________

Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Recherche
dcz
Admin
Admin
 
Posts: 21411
Joined: Fri Apr 28, 2006 9:03 pm

Postby euroman » Wed Jan 24, 2007 4:14 pm

OK - I have:

1. installed the simple rewrite update (after which everything worked fine)

2. Installed zerodup.

After 2. I have strage problems

fx -http://www.mysite.dk/login.php says page not exist

When I am logged in and try to log out it says -http://www.mysite.dk/login.php?logout=true&sid=1b5b7fd7730c70522f39cb3bf9f7551b

does not exist.

HTTP Status Code: HTTP/1.1 301
is ok
Last edited by euroman on Sat Mar 17, 2007 6:32 pm, edited 1 time in total.
euroman
PR0
PR0
 
Posts: 81
Joined: Sat Oct 21, 2006 10:18 pm

Postby dcz » Wed Jan 24, 2007 4:25 pm

Ho, I see.

So the problem is not login.php, it's just that after you log-in, you're redirected to -http://www.example.com/index.php, which by default will as well be redirected to -http://www.example.com/

So, you see :

Moved Permanently
The document has moved here.

Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.


Which is only telling you that the url was moved permanently but without redirecting (it should).

So possible causes :
- ErrorDocument : As the message mention it, did you implement some custom ErrorDocument ? Including 301 headers ?
- problem with code install. If you look at the link provided in the "here" link in the error message returned, you'll see it's the same link as the one that should be redirected, the one requested.

So it could only be because of the additional 500, but could as well mean you did not install all the mod properly.

So please tell me more about your ErrorDocument settings.

++
Last edited by dcz on Mon Mar 19, 2007 9:43 pm, edited 1 time in total.
Useful links :
SEO Forum || SEO Directory || SEO phpBB || Search
____________________

Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Recherche
dcz
Admin
Admin
 
Posts: 21411
Joined: Fri Apr 28, 2006 9:03 pm

Postby euroman » Wed Jan 24, 2007 4:28 pm

Sorry, what is a ErrorDocument? Where do I find ErrorDocument settings?
euroman
PR0
PR0
 
Posts: 81
Joined: Sat Oct 21, 2006 10:18 pm

Postby dcz » Wed Jan 24, 2007 4:35 pm

In your .htaccess, or Vhost.

All right, let's do an easier test :

upload a file with this inside :

Code: Select all
<?php

header("Status: 301 Moved Permanently", TRUE, 301);
header("Location: http://www.example.com/");
exit();

?>


Upload it where you want and load it in your browser, you should be redirected to -http://www.thegame-online.dk/

If not, we'll test other options for this, as there are some ;)

++
Last edited by dcz on Mon Mar 19, 2007 9:42 pm, edited 1 time in total.
Useful links :
SEO Forum || SEO Directory || SEO phpBB || Search
____________________

Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Recherche
dcz
Admin
Admin
 
Posts: 21411
Joined: Fri Apr 28, 2006 9:03 pm

Postby euroman » Wed Jan 24, 2007 4:39 pm

I uploaded in a file test.php

Its like it cant find the file:

The page cannot be displayed
The page you are looking for is currently unavailable. The Web site might be experiencing technical difficulties, or you may need to adjust your browser settings.

etc.


Same message both when mod installed and not installed.
euroman
PR0
PR0
 
Posts: 81
Joined: Sat Oct 21, 2006 10:18 pm

Postby dcz » Wed Jan 24, 2007 5:19 pm

All right, try :

Code: Select all
<?php

header("HTTP/1.1 301 Moved Permanently", TRUE, 301);
header("Location: http://www.example.com/");
exit();

?>


As as well, try replacing TRUE, with FALSE, just in case.

It's bad luck, header should work on all servers.

And make sure you upload the test.php file in a browsable folder ;)

++
Last edited by dcz on Mon Mar 19, 2007 9:42 pm, edited 2 times in total.
Useful links :
SEO Forum || SEO Directory || SEO phpBB || Search
____________________

Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Recherche
dcz
Admin
Admin
 
Posts: 21411
Joined: Fri Apr 28, 2006 9:03 pm

Postby euroman » Wed Jan 24, 2007 5:24 pm

(uploaded in root)

As is

Parse error: syntax error, unexpected T_STRING in /customers/thegame-online.dk/thegame-online.dk/httpd.www/test1.php on line 3


FALSE instead of TRUE:

Parse error: syntax error, unexpected T_STRING in /customers/thegame-online.dk/thegame-online.dk/httpd.www/test2.php on line 3
euroman
PR0
PR0
 
Posts: 81
Joined: Sat Oct 21, 2006 10:18 pm

Postby dcz » Wed Jan 24, 2007 5:34 pm

Sorry my fault , an extra ", erf.

Anyway, here is the correct one :
Code: Select all
<?php
header("HTTP/1.1 301 Moved Permanently", TRUE, 301);
header("Location: http://www.example.com/");
exit();
?>
Last edited by dcz on Mon Mar 19, 2007 9:42 pm, edited 1 time in total.
Useful links :
SEO Forum || SEO Directory || SEO phpBB || Search
____________________

Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Recherche
dcz
Admin
Admin
 
Posts: 21411
Joined: Fri Apr 28, 2006 9:03 pm

Postby euroman » Wed Jan 24, 2007 5:42 pm

It takes me to the index page.

When the mod is installed - none of the direct links to posts on the index page works.
euroman
PR0
PR0
 
Posts: 81
Joined: Sat Oct 21, 2006 10:18 pm

Postby dcz » Wed Jan 24, 2007 5:49 pm

With the proper headers ?

If so you could just replace :

Code: Select all
      $http = (@function_exists("getallheaders")) ? "HTTP/1.1 " : "Status: ";


with :

Code: Select all
      $http = "HTTP/1.1 ";


in phpbb_seo/phpbb_seo_class.php, to force the use of HTTP/1.1, the one working.

For you other issue, I'm not sure, try implementing this one, and if you just want to deactivate the zero dupe all at once, you can just add :

Code: Select all
return;


after :

Code: Select all
   function seo_redirect($url, $header = "301 Moved Permanently", $code = 301, $replace = TRUE) {
      global $db;


still in phpbb_seo/phpbb_seo_class.php. And delete it to re-activate the redirections.

Easier to switch from on to of when testing.

++
Useful links :
SEO Forum || SEO Directory || SEO phpBB || Search
____________________

Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Recherche
dcz
Admin
Admin
 
Posts: 21411
Joined: Fri Apr 28, 2006 9:03 pm

Postby euroman » Wed Jan 24, 2007 6:16 pm

dcz wrote:With the proper headers ?

If so you could just replace :

Code: Select all
      $http = (@function_exists("getallheaders")) ? "HTTP/1.1 " : "Status: ";


with :

Code: Select all
      $http = "HTTP/1.1 ";


in phpbb_seo/phpbb_seo_class.php, to force the use of HTTP/1.1, the one working.


++


When I do the above everything works...

With regard to the cited below I dont think I understand: When you say "other issue" what do you mean, sorry?

For you other issue, I'm not sure, try implementing this one, and if you just want to deactivate the zero dupe all at once, you can just add :

Code: Select all
return;


after :

Code: Select all
   function seo_redirect($url, $header = "301 Moved Permanently", $code = 301, $replace = TRUE) {
      global $db;


still in phpbb_seo/phpbb_seo_class.php. And delete it to re-activate the redirections.

Easier to switch from on to of when testing.
euroman
PR0
PR0
 
Posts: 81
Joined: Sat Oct 21, 2006 10:18 pm

Postby dcz » Thu Jan 25, 2007 12:11 am

I confirm, you're running genuine HTTP 301 for all case now :D


So your case was a pretty good example of the header() function behavior under different server and php setup.

That's what's making this mod a bit different than other, but, IMHO, very useful.

You're going to experience a zero duplicate phpBB forum :D

++
Useful links :
SEO Forum || SEO Directory || SEO phpBB || Search
____________________

Liens Utiles :
Forum référencement || Annuaire référencement || Référencement phpBB || Recherche
dcz
Admin
Admin
 
Posts: 21411
Joined: Fri Apr 28, 2006 9:03 pm

Postby euroman » Thu Jan 25, 2007 2:24 pm

I have just tested my site using A1 sitegenerator and I can confirm it is now 100 pct. duplicate free ! Thanks for the great mod :D
euroman
PR0
PR0
 
Posts: 81
Joined: Sat Oct 21, 2006 10:18 pm


Return to Zero duplicate phpBB2

 


  • Related topics
    Replies
    Views
    Last post

Who is online

Users browsing this forum: Google Feedfetcher and 3 guests