View your posts issue

Discussions and support about the different URL Rewriting techniques for phpBB.

Moderator: Moderators

View your posts issue

Postby shabsta » Mon Feb 01, 2010 12:25 pm

Hi all,

We recently installed PHP SEO onto a windows 2003 server running PHP v5 cgi mode with ISAPI_Rewrite 2.8.
After generating the .htaccess file, copying it to the httpd.ini and modifying the rules somewhat we managed to get 98% of url rewriting to work.
One of issues which I cannot get around, if anyone could assist it would be highly appreciated.

View your posts not working.
When clicking on the view your posts URL an IIS 404 page not found error is returned. I've played around with the rules generated by php seo mod but cannot get this to work. (attached is a copy of the ruleset)
Code: Select all
[ISAPI_Rewrite]
RewriteRule ^/forum\.html$ /index.php [I,L]
RewriteRule ^(/[a-z0-9_-]*-f)([0-9]+)(-([0-9]+))?\.html$ /viewforum.php?f=$2&start=$4 [I,L]
RewriteRule ^(/[a-z0-9_-]*-f)([0-9]+)/(topic|[a-z0-9_-]*-t)([0-9]+)(-([0-9]+))?\.html$ /viewtopic.php?f=$2&t=$4&start=$6 [I,L]
RewriteRule ^announces/(topic|[a-z0-9_-]*-t)([0-9]+)(-([0-9]+))?\.html$ /viewtopic.php?t=$2&start=$4 [I,L]
# TOPIC WITHOUT FORUM ID & DELIM ALL MODES
RewriteRule ^/([a-z0-9_-]*)/?(topic|[a-z0-9_-]*-t)([0-9]+)(-([0-9]+))?\.html$ /viewtopic.php?forum_uri=$1&t=$3&start=$5 [I,L]
# PHPBB FILES ALL MODES
RewriteRule ^/resources/[a-z0-9_-]+/(thumb/)?([0-9]+)$ /download/file.php?id=$2&t=$1 [I,L]
# PROFILES ALL MODES WITH ID
RewriteRule ^/(member|[a-z0-9_-]*-u)([0-9]+)\.html$ /memberlist.php?mode=viewprofile&u=$2 [I,L]
# USER MESSAGES ALL MODES WITH ID
RewriteRule ^(member|[a-z0-9_-]*-u)([0-9]+)-(topics|posts)(-([0-9]+))?\.html$ /search.php?author_id=$2&sr=$3&start=$5 [I,L]
# GROUPS ALL MODES
RewriteRule ^/(group|[a-z0-9_-]*-g)([0-9]+)(-([0-9]+))?\.html$ /memberlist.php?mode=group&g=$2&start=$4 [I,L]
# POST
RewriteRule ^/post([0-9]+)\.html$ /viewtopic.php?p=$1 [I,L]
# ACTIVE TOPICS
RewriteRule ^/active-topics(-([0-9]+))?\.html$ /search.php?search_id=active_topics&start=$2&sr=topics [I,L]
# UNANSWERED TOPICS
RewriteRule ^/unanswered(-([0-9]+))?\.html$ /search.php?search_id=unanswered&start=$2&sr=topics [I,L]
# NEW POSTS
RewriteRule ^/newposts(-([0-9]+))?\.html$ /search.php?search_id=newposts&start=$2&sr=topics [I,L]
# THE TEAM
RewriteRule ^/the-team\.html$ /memberlist.php?mode=leaders [I,L]
# HERE IS A GOOD PLACE TO ADD OTHER PHPBB RELATED REWRITERULES

# FORUM WITHOUT ID & DELIM ALL MODES (SAME DELIM)
# THESE THREE LINES MUST BE LOCATED AT THE END OF YOUR HTACCESS TO WORK PROPERLY

RewriteRule ^([a-z0-9_-]+)/?(page([0-9]+)\.html)?$ /viewforum.php?forum_uri=$1&start=$3 [I,L]
# FIX RELATIVE PATHS : FILES
RewriteRule ^.+/(style\.php|ucp\.php|mcp\.php|faq\.php|download/file.php)$ /$1 [I,L]
# FIX RELATIVE PATHS : IMAGES
RewriteRule ^.+/(styles/.*|images/.*)/$ /$1 [I,L]
# END PHPBB PAGES
#####################################################

####SHABS HACK
#RewriteRule ^/(-([0-9]+))?\.html$ /search.php?search_id=egosearch [I,L]
#RewriteRule ^/(-([0-9]+))-(-([0-9]+))?\.html$ /search.php?search_id=egosearch [I,L]

# Below is for this [url=http://www.phpbb-seo.com/en/phpbb-mod-rewrite/article2637.html]Rewriting sporadicly failed to remove SID from rewritten URL[/url]
RewriteRule ^/[a-z0-9_-]*-f([0-9]+)/[a-z0-9_-]*-t([0-9]+)(-([0-9]+))?\.html$ /viewtopic.php\?f=$1&t=$2&start=$4
shabsta
 
Posts: 7
Joined: Mon Feb 01, 2010 4:32 am

Advertisement

Re: View your posts issue

Postby shabsta » Tue Feb 02, 2010 4:38 am

bump..
shabsta
 
Posts: 7
Joined: Mon Feb 01, 2010 4:32 am

Re: View your posts issue

Postby dcz » Sat Feb 06, 2010 5:28 pm

In this post, I detailed a bit more the code change required for isapi_rewrite : IIS - rewriterules for the advanced mod rewrite

It is possible that these two rules will cause problem too :
Code: Select all
# FIX RELATIVE PATHS : FILES
RewriteRule ^.+/(style\.php|ucp\.php|mcp\.php|faq\.php|download/file.php)$ /$1 [I,L]
# FIX RELATIVE PATHS : IMAGES
RewriteRule ^.+/(styles/.*|images/.*)/$ /$1 [I,L]

it's not big deal if you just delete them.

As you seem to have noticed, there seems not to be an equivalent to :
Code: Select all
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l

with isapi_rewrite, so this means that the forum rewritrerule (the one without id) could also catch physical files. I don't have a windows server install to test all this, so I'm not sure that it would catch all directories (dir/) as well, but it would catch all .html files if you where using urls such as forum-url.html for your forums.

The most tricky part is to properly simulate the QSA flag when translating the .htaccess (the (?:\?(.*))? bits), would be simpler without having to, example : Isapi_rewrite phpBB3

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

Re: View your posts issue

Postby shabsta » Sun Feb 07, 2010 7:49 pm

Thanks for the response DCZ

I'll try the two examples you referenced in your post and keep you updated.
If I am unable to resolve the issues then I'll gladly setup a domain on our server and send you details so that you can test this out on a windows server.
shabsta
 
Posts: 7
Joined: Mon Feb 01, 2010 4:32 am

Re: View your posts issue

Postby shabsta » Sun Feb 07, 2010 8:09 pm

I replaced my httpd.ini with this code

Code: Select all
[ISAPI_Rewrite]

#####################################################
# PHPBB SEO REWRITE RULES - ADVANCED
#####################################################
# AUTHOR : dcz www.phpbb-seo.com
# STARTED : 01/2006
#################################
# FORUMS PAGES
###############
# FORUM INDEX REWRITERULE WOULD STAND HERE IF USED. 'forum' REQUIRES TO BE SET AS FORUM INDEX
# RewriteRule ^/forum\.html$ /index.php [I,L]
# FORUM
RewriteRule ^/[a-z0-9_-]*-f([0-9]+)(-([0-9]+))?\.html$ /viewforum.php\?f=$1&start=$3 [I,L]
# TOPIC WITH VIRTUAL FOLDER
RewriteRule ^/[a-z0-9_-]*-f([0-9]+)/[a-z0-9_-]*-t([0-9]+)(-([0-9]+))?\.html$ /viewtopic.php\?f=$1&t=$2&start=$4 [I,L]
# GLOBAL ANNOUNCES WITH VIRTUAL FOLDER
RewriteRule ^/announces/[a-z0-9_-]*-t([0-9]+)(-([0-9]+))?\.html$ /viewtopic.php\?t=$1&start=$3 [I,L]
# TOPIC WITHOUT FORUM ID & DELIM
RewriteRule ^/[a-z0-9_-]*/?[a-z0-9_-]*-t([0-9]+)(-([0-9]+))?\.html$ /viewtopic.php\?t=$1&start=$3 [I,L]
# PROFILES SIMPLE
RewriteRule ^/member([0-9]+)\.html$ /memberlist.php\?mode=viewprofile&u=$1 [I,L]
# USER MESSAGES SIMPLE
RewriteRule ^/messages([0-9]+)(-([0-9]+))?\.html$ /search.php\?author_id=$1&sr=posts&start=$3 [I,L]
# GROUPS SIMPLE
RewriteRule ^/group([0-9]+)(-([0-9]+))?\.html$ /memberlist.php\?mode=group&g=$1&start=$3 [I,L]
# POST
RewriteRule ^/post([0-9]+)\.html$ /viewtopic.php\?p=$1 [QSA,L,NC]
# THE TEAM
RewriteRule ^/the-team\.html$ /memberlist.php\?mode=leaders [I,L]
# HERE IS A GOOD PLACE TO ADD OTHER PHPBB RELATED REWRITERULES

# FORUM WITHOUT ID & DELIM
# THESE FOUR LINES MUST BE LOCATED AT THE END OF YOUR HTACCESS TO WORK PROPERLY
RewriteRule ^/[a-z0-9_-]+(-([0-9]+))?\.html$ /viewforum.php\?start=$2 [I,L]
# END PHPBB PAGES
#####################################################

Which is listed on this page Isapi_rewrite phpBB3
I removed all instances of /impresa as per the original code.
When clicking on "view your posts" I now get the following error
"Content Encoding Error The page you are trying to view cannot be shown because it uses an invalid or unsupported form of compression."

Where as if I use the following code
Code: Select all
    [ISAPI_Rewrite]
    #####################################################
    # PHPBB SEO REWRITE RULES - ADVANCED
    #####################################################
    # AUTHOR : dcz www.phpbb-seo.com
    # STARTED : 01/2006
    #################################
    # FORUMS PAGES
    ###############
    # FORUM INDEX REWRITERULE WOULD STAND HERE IF USED. "forum" REQUIRES TO BE SET AS FORUM INDEX
    # RewriteRule ^/forum/forum\.html(?:\?(.*))?$ /forum/index.php\??1&$1: [I,L]
    # FORUM
    RewriteRule ^/forum/[a-z0-9_-]*-f([0-9]+)/?(page([0-9]+)\.html)?(?:\?(.*))?$ /forum/viewforum.php\?f=$1&start=$3?4&$4: [I,L]
    # TOPIC WITH VIRTUAL FOLDER
    RewriteRule ^/forum/[a-z0-9_-]*-f([0-9]+)/[a-z0-9_-]*-t([0-9]+)(-([0-9]+))?\.html(?:\?(.*))?$ /forum/viewtopic.php\?f=$1&t=$2&start=$4?5&$5: [I,L]
    # GLOBAL ANNOUNCES WITH VIRTUAL FOLDER
    RewriteRule ^/forum/announces/[a-z0-9_-]*-t([0-9]+)(-([0-9]+))?\.html(?:\?(.*))?$ /forum/viewtopic.php\?t=$1&start=$3?4&$4: [I,L]
    # TOPIC WITHOUT FORUM ID & DELIM
    RewriteRule ^/forum/([a-z0-9_-]*)/?[a-z0-9_-]*-t([0-9]+)(-([0-9]+))?\.html(?:\?(.*))?$ /forum/viewtopic.php\?forum_uri=$1&t=$2&start=$4?5&$5: [I,L]
    # PROFILES SIMPLE
    RewriteRule ^/forum/member([0-9]+)\.html(?:\?(.*))?$ /forum/memberlist.php\?mode=viewprofile&u=$1?2&$2: [I,L]
    # USER MESSAGES SIMPLE
    RewriteRule ^/forum/member([0-9]+)-(topics|posts)(-([0-9]+))?\.html(?:\?(.*))?$ /forum/search.php\?author_id=$1&sr=$2&start=$4?5&$5: [I,L]
    # GROUPS SIMPLE
    RewriteRule ^/forum/group([0-9]+)(-([0-9]+))?\.html(?:\?(.*))?$ /forum/memberlist.php\?mode=group&g=$1&start=$3?4&$4: [I,L]
    # POST
    RewriteRule ^/forum/post([0-9]+)\.html$ /forum/viewtopic.php\?p=$1?2&$2: [I,L]
    # ACTIVE TOPICS
    RewriteRule ^/forum/active-topics(-([0-9]+))?\.html(?:\?(.*))?$ /forum/search.php\?search_id=active_topics&start=$2&sr=topics?3&$3: [I,L]
    # UNANSWERED TOPICS
    RewriteRule ^/forum/unanswered(-([0-9]+))?\.html(?:\?(.*))?$ /forum/search.php\?search_id=unanswered&start=$2&sr=topics?3&$3: [I,L]
    # NEW POSTS
    RewriteRule ^/forum/newposts(-([0-9]+))?\.html(?:\?(.*))?$ /forum/search.php\?search_id=newposts&start=$2&sr=topics?3&$3: [I,L]
    # THE TEAM
    RewriteRule ^/forum/the-team\.html(?:\?(.*))?$ /forum/memberlist.php\?mode=leaders?1&$1: [I,L]
    # HERE IS A GOOD PLACE TO ADD OTHER PHPBB RELATED REWRITERULES

    # FORUM WITHOUT ID & DELIM
    # THESE THREE LINES MUST BE LOCATED AT THE END OF YOUR HTACCESS TO WORK PROPERLY

    RewriteRule ^/forum/([a-z0-9_-]+)/?(page([0-9]+)\.html)?(?:\?(.*))?$ /forum/viewforum.php\?forum_uri=$1&start=$3?4&$4: [I,L]
    # END PHPBB PAGES

and remove all instances of /forum
The page "view your posts" works, but I cannot browse forum categories and am returned with a 404 error.
shabsta
 
Posts: 7
Joined: Mon Feb 01, 2010 4:32 am

Re: View your posts issue

Postby shabsta » Sat Feb 13, 2010 10:20 pm

can i get a bump?
shabsta
 
Posts: 7
Joined: Mon Feb 01, 2010 4:32 am

Re: View your posts issue

Postby shabsta » Fri Feb 19, 2010 4:20 am

may be another bump?
shabsta
 
Posts: 7
Joined: Mon Feb 01, 2010 4:32 am

Re: View your posts issue

Postby dcz » Tue Feb 23, 2010 5:37 pm

Where is your forum installed ?

You need to first try to add the httpd.ini in domain's root, and only add the fourm/ bit if phpBB is indeed installed in forum/ (and not anywhere else at the same time).

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

Re: View your posts issue

Postby shabsta » Tue Feb 23, 2010 5:49 pm

Thanks DCZ,

The forum is installed on a windows 2003 server as stated above, the URL is http://honda-racing.co.za and the httpd.ini exists within the root of the site.
I am aware that unless the forum is installed within a directory called forum then one needs to have /forum, hence in the previous example provided I removed all instances of /forum


Looking forward to resolution to this :)
shabsta
 
Posts: 7
Joined: Mon Feb 01, 2010 4:32 am

Re: View your posts issue

Postby dcz » Fri Mar 12, 2010 1:21 pm

The best to work on this matter would be to start with updating to 3.0.7-PL1, then generate a .htaccess for your settings and work on this one as a base for you httpd.ini, because many options will change the .htaccess and it's possible that you're just trying one that does not fit them.

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


Return to phpBB mod Rewrite

 


  • Related topics
    Replies
    Views
    Last post

Who is online

Users browsing this forum: No registered users and 3 guests