Problem with PHPBB SEO on phpbb2

Support for the phpBB2 SEO mods released in the phpBB2 SEO Toolikt forum.

Moderator: Moderators

Problem with PHPBB SEO on phpbb2

Postby JLA » Mon Apr 06, 2009 11:28 pm

We have a site we are moving from a Linux server to a Windows Server. We are also changing the domain name of the site

Everything seems to be working on the linux server but when moving to the windows server ran into some problems

1st - since URL rewrite was being used on Linux - needed to have this functionality on the Windows Server. This was enabled using ISAPI ReWrite.

Everything seemed to be working fine but we are having some problems with certain sections of the site.

When visiting the index.php or some other forum related pages, we are gettings a redirection limit error.

When pulling the logs from the rewrite module you can see what is happening.

For each loop that is being taken during the rewrite process, this is put to the error log

192.168.2.1 192.168.2.1 Mon, 06-Apr-2009 19:16:16 GMT [www.starstyleinc.com/sid#511280083][rid#18423448/initial] (2) init rewrite engine with requested uri /index.html
192.168.2.1 192.168.2.1 Mon, 06-Apr-2009 19:16:16 GMT [www.starstyleinc.com/sid#511280083][rid#18423448/initial] (1) Htaccess process request C:\Program Files\Helicon\ISAPI_Rewrite3\httpd.conf
192.168.2.1 192.168.2.1 Mon, 06-Apr-2009 19:16:16 GMT [www.starstyleinc.com/sid#511280083][rid#18423448/initial] (1) Htaccess process request d:\websites\jessicastyle\site\wwwroot\.htaccess
192.168.2.1 192.168.2.1 Mon, 06-Apr-2009 19:16:16 GMT [www.starstyleinc.com/sid#511280083][rid#18423448/initial] (3) applying pattern '^index\.html$' to uri 'index.html'
192.168.2.1 192.168.2.1 Mon, 06-Apr-2009 19:16:16 GMT [www.starstyleinc.com/sid#511280083][rid#18423448/initial] (1) Rewrite URL to >> /index.php
192.168.2.1 192.168.2.1 Mon, 06-Apr-2009 19:16:16 GMT [www.starstyleinc.com/sid#511280083][rid#18423448/initial] (2) rewrite 'index.html' -> '/index.php'
192.168.2.1 192.168.2.1 Mon, 06-Apr-2009 19:16:16 GMT [www.starstyleinc.com/sid#511280083][rid#18423448/initial] (2) internal redirect with /index.php [INTERNAL REDIRECT]

This is the contents of the HTA file

<files archive.php>
#AcceptPathInfo On # uncomment this if you have apache2
</files>

#Options +FollowSymlinks
RewriteEngine On
RewriteBase /
# FORUM INDEX (un-comment if used)
#
RewriteRule ^index\.html$ /index.php [QSA,NC,L]

# FORUM PROTECTION RULE
RewriteRule ^[a-z0-9_-]+/([^/]+\.html)$ /index.php [R=301,NC,L]
# CATEGORIES
RewriteRule ^[a-z0-9_-]*-c([0-9]+)\.html$ /index.php?c=$1 [QSA,NC,L]
# PAGINATED FORUM
RewriteRule ^[a-z0-9_-]*-f([0-9]+)-([0-9]+)\.html$ /viewforum.php?f=$1&start=$2 [QSA,NC,L]
# FORUM
RewriteRule ^[a-z0-9_-]*-f([0-9]+)\.html$ /viewforum.php?f=$1 [QSA,NC,L]
# PAGINATED TOPIC
RewriteRule ^[a-z0-9_-]*-t([0-9]+)-([0-9]+)\.html$ /viewtopic.php?t=$1&start=$2 [QSA,NC,L]
# TOPIC
RewriteRule ^[a-z0-9_-]*-t([0-9]+)\.html$ /viewtopic.php?t=$1 [QSA,NC,L]
# POST
RewriteRule ^post([0-9]+)\.html$ /viewtopic.php?p=$1 [QSA,NC,L]
#PROFILES
RewriteRule ^member([0-9]+)\.html$ /profile.php?mode=viewprofile&u=$1 [QSA,NC,L]
# ALBUM INDEX
RewriteRule ^album\.html$ /album.php [QSA,NC,L]

# ALBUM PAGINATED INDEX
RewriteRule ^album_kk-([0-9]+)\.html$ /album_kk.php?i=$1&start=$2 [QSA,NC,L]

# ALBUM PAGINATED CAT
RewriteRule ^[a-z0-9_-]+-ac([0-9]+)-([0-9]+)\.html$ /album_cat.php?cat_id=$1&start=$2 [QSA,NC,L]
# ALBUM CAT
RewriteRule ^[a-z0-9_-]+-ac([0-9]+)\.html$ /album_cat.php?cat_id=$1 [QSA,NC,L]
# ALBUM PAGINATED PIC
RewriteRule ^[a-z0-9_-]+-sp([0-9]+)-([0-9]+)\.html$ /album_showpage.php?pic_id=$1&start=$2 [QSA,NC,L]
# ALBUM PIC with full option
RewriteRule ^[a-z0-9_-]+-sp([0-9]+)-?(full)?\.html$ /album_showpage.php?pic_id=$1&$2 [QSA,NC,L]
# ALL PICS PAGINATED
RewriteRule ^all-pics-([0-9]+)\.html$ /album_allpics.php?start=$1 [QSA,NC,L]
# ALL PICS
RewriteRule ^all-pics\.html$ /album_allpics.php [QSA,NC,L]
# THUMBNAILS
RewriteRule ^[a-z0-9_-]+-thumb([0-9]+)\.jpg$ /album_thumbnail.php?pic_id=$1 [QSA,NC,L]
# MED
RewriteRule ^[a-z0-9_-]+-mid([0-9]+)\.jpg$ /album_picm.php?pic_id=$1 [QSA,NC,L]
# FULL
RewriteRule ^[a-z0-9_-]+-pic([0-9]+)\.jpg$ /album_pic.php?pic_id=$1 [QSA,NC,L]


RewriteCond %{HTTP_HOST} ^.*$
RewriteRule ^js/index.php$ "http\:\/\/www\.starstyleinc\.com\/index\.html" [R=301,L]
RewriteCond %{HTTP_HOST} ^.*$
RewriteRule ^mobile/?$ "http\:\/\/www\.starstyleinc\.com\/mobile\/index\.php" [R=301,L]

The ISAPI Rewrite people feel their tool works fine as other pages on the site are working without issue. But it is pages such as the index.php that are having this looping problem

Thanks
JLA
 
Posts: 6
Joined: Mon Apr 06, 2009 11:06 pm

Advertisement

Re: Problem with PHPBB SEO on phpbb2

Postby dcz » Tue Apr 07, 2009 9:04 am

Try to drop :
Code: Select all
# FORUM PROTECTION RULE
RewriteRule ^[a-z0-9_-]+/([^/]+\.html)$ /index.php [R=301,NC,L]


It's not useful with the zero dupe anyway, and could be the guilty one here.

Now, I'm surprised to see that you did not have to tweak your rewriterules more than that, I have few experience with isapi_rewrite, but each time, I needed to escape the question marks in the right part :
RewriteRule ^[a-z0-9_-]*-c([0-9]+)\.html$ /index.php\?c=$1 [QSA,NC,L]


And the QSA flag was just useless to pass the eventual extra variables, such as SIDs to the script. The above rewriterule would result in :
Code: Select all
RewriteRule ^/[a-z0-9_-]*-c([0-9]+)\.html(?:\?(.*))?$ /index.php\?c=$1?2&$2: [I,L]


to fully work (as you see, I needed to capture the eventual QS and then pass it to the script manually to simulate the mod_rewrite QSA flag).

Then, I'm not very sure about what you want to do with this :
Code: Select all
RewriteCond %{HTTP_HOST} ^.*$
RewriteRule ^js/index.php$ "http\:\/\/www\.starstyleinc\.com\/index\.html" [R=301,L]
RewriteCond %{HTTP_HOST} ^.*$
RewriteRule ^mobile/?$ "http\:\/\/www\.starstyleinc\.com\/mobile\/index\.php" [R=301,L]


But to redirect for example example.com/index.php to example.com/, I would use :
Code: Select all
RewriteRule  /index.php http://www.example.com/ [I,O,RP,L]


You'll find more threads about this if you search a bit.

++
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: 21238
Joined: Fri Apr 28, 2006 9:03 pm

Re: Problem with PHPBB SEO on phpbb2

Postby JLA » Tue Apr 07, 2009 2:22 pm

dcz wrote:Try to drop :
Code: Select all
# FORUM PROTECTION RULE
RewriteRule ^[a-z0-9_-]+/([^/]+\.html)$ /index.php [R=301,NC,L]


It's not useful with the zero dupe anyway, and could be the guilty one here.

Now, I'm surprised to see that you did not have to tweak your rewriterules more than that, I have few experience with isapi_rewrite, but each time, I needed to escape the question marks in the right part :
RewriteRule ^[a-z0-9_-]*-c([0-9]+)\.html$ /index.php\?c=$1 [QSA,NC,L]


And the QSA flag was just useless to pass the eventual extra variables, such as SIDs to the script. The above rewriterule would result in :
Code: Select all
RewriteRule ^/[a-z0-9_-]*-c([0-9]+)\.html(?:\?(.*))?$ /index.php\?c=$1?2&$2: [I,L]


to fully work (as you see, I needed to capture the eventual QS and then pass it to the script manually to simulate the mod_rewrite QSA flag).

Then, I'm not very sure about what you want to do with this :
Code: Select all
RewriteCond %{HTTP_HOST} ^.*$
RewriteRule ^js/index.php$ "http\:\/\/www\.starstyleinc\.com\/index\.html" [R=301,L]
RewriteCond %{HTTP_HOST} ^.*$
RewriteRule ^mobile/?$ "http\:\/\/www\.starstyleinc\.com\/mobile\/index\.php" [R=301,L]


But to redirect for example example.com/index.php to example.com/, I would use :
Code: Select all
RewriteRule  /index.php http://www.example.com/ [I,O,RP,L]


You'll find more threads about this if you search a bit.

++

Thanks for the info. We had nothing to do with tweaking the rules. This is what the site owner is using currently on the unix box they have the original site on. These problems have only manifested during the moving phase of this site to a windows server.

Tried the above changes you recommended at same result

For example when attempting to visit http://www.starstyleinc.com/index.php - just goes into an infinite redirection loop. Same thing with any forum cat/topic page.

But when visiting one of the album pages, it works fine with the exception of direct album picture page - same result. Here is the one of the log entries when going to index.php

Code: Select all
192.168.2.1 192.168.2.1  Tue, 07-Apr-2009  10:17:06 GMT [www.starstyleinc.com/sid#511280083][rid#18423448/initial] (2) init rewrite engine with requested uri /index.html
192.168.2.1 192.168.2.1  Tue, 07-Apr-2009  10:17:06 GMT [www.starstyleinc.com/sid#511280083][rid#18423448/initial] (1) Htaccess process request C:\Program Files\Helicon\ISAPI_Rewrite3\httpd.conf
192.168.2.1 192.168.2.1  Tue, 07-Apr-2009  10:17:06 GMT [www.starstyleinc.com/sid#511280083][rid#18423448/initial] (1) Htaccess process request d:\websites\jessicastyle\site\wwwroot\.htaccess
192.168.2.1 192.168.2.1  Tue, 07-Apr-2009  10:17:06 GMT [www.starstyleinc.com/sid#511280083][rid#18423448/initial] (3) applying pattern '^index\.html$' to uri 'index.html'
192.168.2.1 192.168.2.1  Tue, 07-Apr-2009  10:17:06 GMT [www.starstyleinc.com/sid#511280083][rid#18423448/initial] (1) Rewrite URL to >> /index.php
192.168.2.1 192.168.2.1  Tue, 07-Apr-2009  10:17:06 GMT [www.starstyleinc.com/sid#511280083][rid#18423448/initial] (2) rewrite 'index.html' -> '/index.php'
192.168.2.1 192.168.2.1  Tue, 07-Apr-2009  10:17:06 GMT [www.starstyleinc.com/sid#511280083][rid#18423448/initial] (2) internal redirect with /index.php [INTERNAL REDIRECT]
JLA
 
Posts: 6
Joined: Mon Apr 06, 2009 11:06 pm

Re: Problem with PHPBB SEO on phpbb2

Postby dcz » Fri Apr 10, 2009 8:59 am

mm, windows server can really be a pain, could you post your httpd.ini here ?
Or do you only use an .htaccess ?
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: 21238
Joined: Fri Apr 28, 2006 9:03 pm

Re: Problem with PHPBB SEO on phpbb2

Postby JLA » Fri Apr 10, 2009 3:41 pm

dcz wrote:mm, windows server can really be a pain, could you post your httpd.ini here ?
Or do you only use an .htaccess ?


Only the .htaccess is being used

Thanks
JLA
 
Posts: 6
Joined: Mon Apr 06, 2009 11:06 pm

Re: Problem with PHPBB SEO on phpbb2

Postby dcz » Wed Apr 15, 2009 1:46 pm

So I guess that my above post is irrelevant. Sorry, I did not even know that windows server could run a .htaccess file.
You could still try to use an httpd.ini instead, or ask where isapi_rewrite is supported.
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: 21238
Joined: Fri Apr 28, 2006 9:03 pm

Re: Problem with PHPBB SEO on phpbb2

Postby JLA » Wed Apr 15, 2009 2:04 pm

dcz wrote:So I guess that my above post is irrelevant. Sorry, I did not even know that windows server could run a .htaccess file.
You could still try to use an httpd.ini instead, or ask where isapi_rewrite is supported.


The .htaccess is available by using ISAPI Rewrite. It functions just as this does on Apache.
JLA
 
Posts: 6
Joined: Mon Apr 06, 2009 11:06 pm

Re: Problem with PHPBB SEO on phpbb2

Postby dcz » Sun Apr 19, 2009 11:41 am

http://www.starstyleinc.com/index.php seems to properly redirect now, even though the header sent is not fully correct :
HTTP Status Code: HTTP/1.1 301 Undescribed
Connection: close
Date: Sun, 19 Apr 2009 11:39:27 GMT
Server: Microsoft-IIS/6.0
X-Powered-By: ASP.NET
X-Powered-By: PHP/4.4.7
Status: 301 Moved Permanently
Location: http://starstyleinc.com/index.html
Content-type: text/html

We should see Moved Permanently instead of Undescribed, but it should still be ok.

Have you found a solution ?
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: 21238
Joined: Fri Apr 28, 2006 9:03 pm

Re: Problem with PHPBB SEO on phpbb2

Postby JLA » Sun Apr 19, 2009 11:01 pm

Yes we did

This code had to be added at the top of the affect pages

Code: Select all
if (isset($_SERVER['HTTP_X_REWRITE_URL']))
{
$_SERVER['REQUEST_URI'] = $_SERVER['HTTP_X_REWRITE_URL'];
}


Everything seems to be better at http://www.starstyleinc.com
JLA
 
Posts: 6
Joined: Mon Apr 06, 2009 11:06 pm


Return to phpBB2 SEO MODS

 


  • Related topics
    Replies
    Views
    Last post

Who is online

Users browsing this forum: No registered users and 1 guest


 
cron