Mod Rewrite problem after update to 3.2 from phpBB SEO

Get help with installation and running phpBB 3.2.x here. Please do not post bug reports, feature requests, or extension related questions here.
lizardx
Registered User
Posts: 21
Joined: Fri Feb 24, 2017 10:19 am

Mod Rewrite problem after update to 3.2 from phpBB SEO

Post by lizardx »

Hi,

I have an older phpbb board with SEO Urls and with version 3.0.12. Now I updated to 3.2 with the normal urls, because phpBb SEO is not supported anymore (http://www.phpbb-seo.com/). Now I want to use the basic and normal version of phpbb´and no SEO urls anymore.

Now I have a big problem with all my urls. Before update, I had urls like:

forum1.html
topic7679.html
topic7679-15.html

Now I have the normal urls:

viewforum.php?f=5
viewtopic.php?f=5&t=2400
viewtopic.php?f=5&t=2400&start=15


Is it possible to move all older urls via Mod Rewrite and 301 to the active ones?

Here is my old htaccess file:

Code: Select all

RewriteBase /
# HERE IS A GOOD PLACE TO FORCE CANONICAL DOMAIN
# RewriteCond %{HTTP_HOST} !^forum\.domain\.com$ [NC]
# RewriteRule ^(.*)$ http://forum.domain.com/$1 [QSA,L,R=301]

# DO NOT GO FURTHER IF THE REQUESTED FILE / DIR DOES EXISTS
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule . - [L]
#####################################################
# PHPBB SEO REWRITE RULES ALL MODES
#####################################################
# 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 [QSA,L,NC]
# FORUM ALL MODES
RewriteRule ^(forum|[a-z0-9_-]*-f)([0-9]+)(-([0-9]+))?\.html$ /viewforum.php?f=$2&start=$4 [QSA,L,NC]
# TOPIC WITH VIRTUAL FOLDER ALL MODES
RewriteRule ^(forum|[a-z0-9_-]*-f)([0-9]+)/(topic|[a-z0-9_-]*-t)([0-9]+)(-([0-9]+))?\.html$ /viewtopic.php?f=$2&t=$4&start=$6 [QSA,L,NC]
# 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 [QSA,L,NC]
# PHPBB FILES ALL MODES
RewriteRule ^resources/[a-z0-9_-]+/(thumb/)?([0-9]+)$ /download/file.php?id=$2&t=$1 [QSA,L,NC]
# PROFILES ALL MODES WITH ID
RewriteRule ^(member|[a-z0-9_-]*-u)([0-9]+)/?$ /memberlist.php?mode=viewprofile&u=$2 [QSA,L,NC]
# USER MESSAGES ALL MODES WITH ID
RewriteRule ^(member|[a-z0-9_-]*-u)([0-9]+)/(topics|posts)/?(page([0-9]+)\.html)?$ /search.php?author_id=$2&sr=$3&start=$5 [QSA,L,NC]
# GROUPS ALL MODES
RewriteRule ^(group|[a-z0-9_-]*-g)([0-9]+)(-([0-9]+))?\.html$ /memberlist.php?mode=group&g=$2&start=$4 [QSA,L,NC]
# POST
RewriteRule ^post([0-9]+)\.html$ /viewtopic.php?p=$1 [QSA,L,NC]
# ACTIVE TOPICS
RewriteRule ^active-topics(-([0-9]+))?\.html$ /search.php?search_id=active_topics&start=$2&sr=topics [QSA,L,NC]
# UNANSWERED TOPICS
RewriteRule ^unanswered(-([0-9]+))?\.html$ /search.php?search_id=unanswered&start=$2&sr=topics [QSA,L,NC]
# NEW POSTS
RewriteRule ^newposts(-([0-9]+))?\.html$ /search.php?search_id=newposts&start=$2&sr=topics [QSA,L,NC]
# UNREAD POSTS
RewriteRule ^unreadposts(-([0-9]+))?\.html$ /search.php?search_id=unreadposts&start=$2 [QSA,L,NC]
# THE TEAM
RewriteRule ^the-team\.html$ /memberlist.php?mode=leaders [QSA,L,NC]
# HERE IS A GOOD PLACE TO ADD OTHER PHPBB RELATED REWRITERULES

#####################################################
# GYM Sitemaps & RSS
# Global channels
RewriteRule ^rss(/(news)+)?(/(digest)+)?(/(short|long)+)?/?$ /gymrss.php?channels&$2&$4&$6 [QSA,L,NC]
# HTML Global news & maps
RewriteRule ^(news|maps)/?(page([0-9]+)\.html)?$ /map.php?$1&start=$3 [QSA,L,NC]
# END GYM Sitemaps & RSS
#####################################################

# FORUM WITHOUT ID & DELIM ALL MODES
# THESE FOUR LINES MUST BE LOCATED AT THE END OF YOUR HTACCESS TO WORK PROPERLY
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([a-z0-9_-]+)(-([0-9]+))\.html$ /viewforum.php?forum_uri=$1&start=$3 [QSA,L,NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([a-z0-9_-]+)\.html$ /viewforum.php?forum_uri=$1 [QSA,L,NC]
# FIX RELATIVE PATHS : FILES
RewriteRule ^.+/(style\.php|ucp\.php|mcp\.php|faq\.php|download/file.php)$ /$1 [QSA,L,NC,R=301]
# FIX RELATIVE PATHS : IMAGES
RewriteRule ^.+/(styles/.*|images/.*)/$ /$1 [QSA,L,NC,R=301]
# END PHPBB PAGES

It would be very nice if somebody can help.
User avatar
Brf
Support Team Member
Support Team Member
Posts: 53379
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Re: Mod Rewrite problem after update to 3.2 from phpBB SEO

Post by Brf »

We do not support phpBB-seo. You will need to seek support at phpbb-seo.com
lizardx
Registered User
Posts: 21
Joined: Fri Feb 24, 2017 10:19 am

Re: Mod Rewrite problem after update to 3.2 from phpBB SEO

Post by lizardx »

Brf wrote: Fri Feb 24, 2017 12:45 pm We do not support phpBB-seo. You will need to seek support at phpbb-seo.com
As I wrote, there is no support anymore from phpbb-seo.com (http://phpbb-seo.com/). And I want to use the normal urls and no seo urls (this I wrote, too). Sorry fpr my bad english.

It would be nice if somebody else can help, because its very important.
Peter77sx
Registered User
Posts: 3260
Joined: Wed Nov 09, 2005 2:51 pm

Re: Mod Rewrite problem after update to 3.2 from phpBB SEO

Post by Peter77sx »

It's done for you already.

3.2 comes with canonical URL meta tag in overall_header.html it sets an 301 for all your URL's. at least google treats it this way. Make sure it is enabled.
lizardx
Registered User
Posts: 21
Joined: Fri Feb 24, 2017 10:19 am

Re: Mod Rewrite problem after update to 3.2 from phpBB SEO

Post by lizardx »

No... I want to redirect all older urls to the new ones.

Like this:

From topic7679.html to viewtopic.php?f=5&t=2400

In my board there are thousands of internal links. Now I updated my board, and if you click on these internal topic links, you get an 404.


Is there no chance to move all older urls to the new ones with Mod Rewrite?
lizardx
Registered User
Posts: 21
Joined: Fri Feb 24, 2017 10:19 am

Re: Mod Rewrite problem after update to 3.2 from phpBB SEO

Post by lizardx »

Nobody can help? :(
User avatar
RMcGirr83
Former Team Member
Posts: 22011
Joined: Wed Jun 22, 2005 4:33 pm
Location: Your display
Name: Rich McGirr

Re: Mod Rewrite problem after update to 3.2 from phpBB SEO

Post by RMcGirr83 »

phpbbseo can if they were active which they aren't. You're pretty much on your own unless you pay someone to fix it for you.
Former Modifications/Extensions Team Member | My extensions | github | All requests for support via PM will be ignored
Appreciate the extensions/mods/support then buy me a beer Image
User avatar
canonknipser
Registered User
Posts: 2096
Joined: Thu Sep 08, 2011 4:16 am
Location: Germany
Name: Frank Jakobs
Contact:

Re: Mod Rewrite problem after update to 3.2 from phpBB SEO

Post by canonknipser »

Most of the "magic" from phpBB-seo was done via url rewriting - all information needed by phpBB is still in those "seo"-urls and redirected with web server commands (rewrite) to the native phpBB-scripts.

If you have kept a backup of the rewrite rules from you seo implementation (should be in .htaccess for apache servers), you simply put them back to the current .htaccess, and extend them to send a 301 htm status code (moved permanently) to the caller - this will update google and bing and other search engines.

Leave the internal links in your posts unchanged, maybe fix those in "link forums", Forum descriptions, static pages in your web site etc.

You should be able to find a lot of example how to properly find / interpret / modify those rewrite statements, just google for "mod rewrite".
Just as a hint: forum1.html should become viewforum.php?f=1, not viewforum.php?f=5 as in your example, topic7679.html -> viewtopic.php?t=7679 and so on
Greetings, Frank
phpbb.de support team member
English is not my native language - no support via PM or mail
New arrival - Extensions and scripts for phpBB
lizardx
Registered User
Posts: 21
Joined: Fri Feb 24, 2017 10:19 am

Re: Mod Rewrite problem after update to 3.2 from phpBB SEO

Post by lizardx »

Thank you very much, Frank.
topic7679.html -> viewtopic.php?t=7679 and so on
It is not so easy, it must be topic7679.html -> viewtopic.php?f=1&t=7679. So, there is the forum ID, too.
If you have kept a backup of the rewrite rules from you seo implementation (should be in .htaccess for apache servers), you simply put them back to the current .htaccess, and extend them to send a 301 htm status code (moved permanently) to the caller - this will update google and bing and other search engines.
I have no idea how to do this. I tried some things but without success. Here is my older htaccess file:

Code: Select all

RewriteBase /
# HERE IS A GOOD PLACE TO FORCE CANONICAL DOMAIN
# RewriteCond %{HTTP_HOST} !^forum\.domain\.com$ [NC]
# RewriteRule ^(.*)$ http://forum.domain.com/$1 [QSA,L,R=301]

# DO NOT GO FURTHER IF THE REQUESTED FILE / DIR DOES EXISTS
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule . - [L]
#####################################################
# PHPBB SEO REWRITE RULES ALL MODES
#####################################################
# 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 [QSA,L,NC]
# FORUM ALL MODES
RewriteRule ^(forum|[a-z0-9_-]*-f)([0-9]+)(-([0-9]+))?\.html$ /viewforum.php?f=$2&start=$4 [QSA,L,NC]
# TOPIC WITH VIRTUAL FOLDER ALL MODES
RewriteRule ^(forum|[a-z0-9_-]*-f)([0-9]+)/(topic|[a-z0-9_-]*-t)([0-9]+)(-([0-9]+))?\.html$ /viewtopic.php?f=$2&t=$4&start=$6 [QSA,L,NC]
# 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 [QSA,L,NC]
# PHPBB FILES ALL MODES
RewriteRule ^resources/[a-z0-9_-]+/(thumb/)?([0-9]+)$ /download/file.php?id=$2&t=$1 [QSA,L,NC]
# PROFILES ALL MODES WITH ID
RewriteRule ^(member|[a-z0-9_-]*-u)([0-9]+)/?$ /memberlist.php?mode=viewprofile&u=$2 [QSA,L,NC]
# USER MESSAGES ALL MODES WITH ID
RewriteRule ^(member|[a-z0-9_-]*-u)([0-9]+)/(topics|posts)/?(page([0-9]+)\.html)?$ /search.php?author_id=$2&sr=$3&start=$5 [QSA,L,NC]
# GROUPS ALL MODES
RewriteRule ^(group|[a-z0-9_-]*-g)([0-9]+)(-([0-9]+))?\.html$ /memberlist.php?mode=group&g=$2&start=$4 [QSA,L,NC]
# POST
RewriteRule ^post([0-9]+)\.html$ /viewtopic.php?p=$1 [QSA,L,NC]
# ACTIVE TOPICS
RewriteRule ^active-topics(-([0-9]+))?\.html$ /search.php?search_id=active_topics&start=$2&sr=topics [QSA,L,NC]
# UNANSWERED TOPICS
RewriteRule ^unanswered(-([0-9]+))?\.html$ /search.php?search_id=unanswered&start=$2&sr=topics [QSA,L,NC]
# NEW POSTS
RewriteRule ^newposts(-([0-9]+))?\.html$ /search.php?search_id=newposts&start=$2&sr=topics [QSA,L,NC]
# UNREAD POSTS
RewriteRule ^unreadposts(-([0-9]+))?\.html$ /search.php?search_id=unreadposts&start=$2 [QSA,L,NC]
# THE TEAM
RewriteRule ^the-team\.html$ /memberlist.php?mode=leaders [QSA,L,NC]
# HERE IS A GOOD PLACE TO ADD OTHER PHPBB RELATED REWRITERULES

#####################################################
# GYM Sitemaps & RSS
# Global channels
RewriteRule ^rss(/(news)+)?(/(digest)+)?(/(short|long)+)?/?$ /gymrss.php?channels&$2&$4&$6 [QSA,L,NC]
# HTML Global news & maps
RewriteRule ^(news|maps)/?(page([0-9]+)\.html)?$ /map.php?$1&start=$3 [QSA,L,NC]
# END GYM Sitemaps & RSS
#####################################################

# FORUM WITHOUT ID & DELIM ALL MODES
# THESE FOUR LINES MUST BE LOCATED AT THE END OF YOUR HTACCESS TO WORK PROPERLY
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([a-z0-9_-]+)(-([0-9]+))\.html$ /viewforum.php?forum_uri=$1&start=$3 [QSA,L,NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([a-z0-9_-]+)\.html$ /viewforum.php?forum_uri=$1 [QSA,L,NC]
# FIX RELATIVE PATHS : FILES
RewriteRule ^.+/(style\.php|ucp\.php|mcp\.php|faq\.php|download/file.php)$ /$1 [QSA,L,NC,R=301]
# FIX RELATIVE PATHS : IMAGES
RewriteRule ^.+/(styles/.*|images/.*)/$ /$1 [QSA,L,NC,R=301]
# END PHPBB PAGES

Is there any chance to fix it? I mean, is there a solution how to move the older urls to the new ones, with 301?

I have 4 phpBB boards with SEO urls. Two weeks ago, I updated a smaller board from 3.0.12 with seo url to the new 3.2 version. Actually, there is a big chaos... Two weerks ago after update, I submitted a xml sitemap to google. Now, more than 50% of all indexed sitesibn google are still the old SEO urls which move to a 404 :(
A think I must get new Mod Rewrite Rules with 301 to solve this problem...
User avatar
Brf
Support Team Member
Support Team Member
Posts: 53379
Joined: Tue May 10, 2005 7:47 pm
Location: {postrow.POSTER_FROM}
Contact:

Re: Mod Rewrite problem after update to 3.2 from phpBB SEO

Post by Brf »

lizardx wrote: Mon Mar 06, 2017 2:17 pm Thank you very much, Frank.
topic7679.html -> viewtopic.php?t=7679 and so on
It is not so easy, it must be topic7679.html -> viewtopic.php?f=1&t=7679. So, there is the forum ID, too.
No. Your re-write would have no idea what the forum is, and the forum is not used for topics unless it is a global announcement.
lizardx
Registered User
Posts: 21
Joined: Fri Feb 24, 2017 10:19 am

Re: Mod Rewrite problem after update to 3.2 from phpBB SEO

Post by lizardx »

Brf wrote: Mon Mar 06, 2017 2:21 pm
lizardx wrote: Mon Mar 06, 2017 2:17 pm Thank you very much, Frank.
topic7679.html -> viewtopic.php?t=7679 and so on
It is not so easy, it must be topic7679.html -> viewtopic.php?f=1&t=7679. So, there is the forum ID, too.
No. Your re-write would have no idea what the forum is, and the forum is not used for topics unless it is a global announcement.
If you visit my forum on http://www.slackline-tipps.de/forum/viewforum.php?f=3 you see urls like forum/viewtopic.php?f=3&t=97 (This is just a smaller forum of me. I have bigger ones, but first I would like to update this smaller forum...)
User avatar
stevemaury
Support Team Member
Support Team Member
Posts: 52767
Joined: Thu Nov 02, 2006 12:21 am
Location: The U.P.
Name: Steve
Contact:

Re: Mod Rewrite problem after update to 3.2 from phpBB SEO

Post by stevemaury »

Yes, but the topic number is unique. The forum_id is not needed. I have removed the "f=556" from this link:
https://www.phpbb.com/community/viewtopic.php?&t=2411191 and it still goes the same place.

viewtopic.php?&t=2411191
I can stop all your spam. I can upgrade or update your Board. PM or email me. (Paid support)
User avatar
RMcGirr83
Former Team Member
Posts: 22011
Joined: Wed Jun 22, 2005 4:33 pm
Location: Your display
Name: Rich McGirr

Re: Mod Rewrite problem after update to 3.2 from phpBB SEO

Post by RMcGirr83 »

I think the OP doesn't understand the difference between viewforum and viewtopic. Viewforum requires the f parameter, viewtopic doesn't.

Wonder what the SEO forum links look like.
Former Modifications/Extensions Team Member | My extensions | github | All requests for support via PM will be ignored
Appreciate the extensions/mods/support then buy me a beer Image
construaprende
Registered User
Posts: 59
Joined: Tue May 18, 2004 7:40 pm
Location: Mexico
Contact:

Re: Mod Rewrite problem after update to 3.2 from phpBB SEO

Post by construaprende »

I have the same problem

Have you found a solution?
User avatar
Mick
Support Team Member
Support Team Member
Posts: 26456
Joined: Fri Aug 29, 2008 9:49 am

Re: Mod Rewrite problem after update to 3.2 from phpBB SEO

Post by Mick »

@construaprende: Please start your own topic by please filling out the Support Request Template and posting it back in your new topic to enable us to assist you better.
  • "The more connected we get the more alone we become" - Kyle Broflovski©
  • "The good news is hell is just the product of a morbid human imagination.
    The bad news is, whatever humans can imagine, they can usually create.
    " - Harmony Cobel
Locked

Return to “[3.2.x] Support Forum”