.htaccess Redirect 301

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

Moderator: Moderators

.htaccess Redirect 301

Postby jesperfrier » Tue Mar 24, 2009 8:42 pm

I am renaming forums and need to redirect old URLs to new URLs to avoid duplicate content.

I have renamed one of the hidden forums to TEST this Redirect:
Code: Select all
Redirect 301 /phpBB2/partners-only-f17.html http://www.emailsignature.eu/phpBB2/office-add-on-partners-only-f17.html


The response is "301 Moved Permanently" (which is fine), but the URL gets "?f=17" added at the end:
Code: Select all
http://www.emailsignature.eu/phpBB2/office-add-on-partners-only-f17.html[color=#FF0000]?f=17[/color]


I guess the RewriteRule in my .htaccess is causing the problem, but I have no clue how to fix it ... can you? :)

THANKS!

This is my .htaccess:
Code: Select all
<Files config.php>

Deny from all

</Files>



#DirectoryIndex index.php index.html index.htm



Redirect 301 /index.html http://www.emailsignature.eu/phpBB2/index.php



RewriteEngine On



RewriteRule ^phpBB2/msi-package-t569\.html$ /phpBB2/msi-package-t571.html



# SEO URL [mgutt]

RewriteRule !\.html$ - [L]

RewriteRule ^phpBB2/[a-z0-9-]+-([pt])([0-9]+)\.html$ /phpBB2/viewtopic.php?$1=$2 [L]

RewriteRule ^phpBB2/[a-z0-9-]+-f([0-9]+)\.html$ /phpBB2/viewforum.php?f=$1 [L]

RewriteRule ^phpBB2/[a-z0-9-]+-c([0-9]+)\.html$ /phpBB2/index.php?c=$1 [L]

RewriteRule ^phpBB2/[a-z0-9-]+-u([0-9]+)\.html$ /phpBB2/profile.php?mode=viewprofile&u=$1 [L]

RewriteRule ^phpBB2/([a-zA-Z0-9_]+),([^/,]+),([^/,]*)([^/]*\.html)$ phpBB2/$1$4?$2=$3 [QSA,N]

RewriteRule ^phpBB2/[a-z0-9-]+-([pt])([0-9]+),([^/,]+),([^/,]*)([^/]*\.html)$ phpBB2/viewtopic$5?$1=$2&$3=$4 [QSA,N]

RewriteRule ^phpBB2/[a-z0-9-]+-f([0-9]+),([^/,]+),([^/,]*)([^/]*\.html)$ phpBB2/viewforum$4?f=$1&$2=$3 [QSA,N]

RewriteRule ^phpBB2/([a-zA-Z0-9_]+)\.html$ /phpBB2/$1.php [L]


#Forum names changed and to avoid duplicate content
Redirect 301 /phpBB2/partners-only-f17.html http://www.emailsignature.eu/phpBB2/office-add-on-partners-only-f17.html
jesperfrier
 
Posts: 3
Joined: Tue Mar 24, 2009 8:29 pm

Advertisement

Re: .htaccess Redirect 301

Postby jesperfrier » Wed Mar 25, 2009 8:34 pm

Solved the issue by using RewriteRule:

Code: Select all
RewriteRule ^phpBB2/partners-only-f17\.html$ http://www.emailsignature.eu/phpBB2/office-add-on-partners-only-f17.html [R=301,L]
jesperfrier
 
Posts: 3
Joined: Tue Mar 24, 2009 8:29 pm

Re: .htaccess Redirect 301

Postby dcz » Sun Mar 29, 2009 12:09 pm

If you just want to redirect forum url with ids, you have nothing to do beside installing / activating the zero duplicate mod.

It will take care of all renamed urls with ids (topic, forums, user etc ...) directly.
Try this for example :
Code: Select all
http://www.phpbb-seo.com/en/is-this/a-duplicate-t1220.html


++
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: .htaccess Redirect 301

Postby jesperfrier » Wed Apr 01, 2009 7:12 am

Thanks!
Unfortunately, I'm still stuck on phpBB2 ... :wink:

Can you by any chance recommend assistance with upgrading from phpBB2 -> phpBB3?
The main goal is preserving the Google indexed pages. I will of course pay for the services.
jesperfrier
 
Posts: 3
Joined: Tue Mar 24, 2009 8:29 pm

Re: .htaccess Redirect 301

Postby dcz » Thu Apr 02, 2009 8:51 am

We have a zero dupe mod for phpBB2 here : phpbb2-zero-duplicate/

About converting, this topic can help : How to convert from phpbb2 to phpbb3 seo premod
All you'll need to do to properly redirect your phpBB2 url to the phpBB3 ones will be to keep your phpBB2 rewriterules up and running, but linked to the phpBB3 scripts (instead of the phpBB2 ones), which usually can be done by just adding the phpBB2 rewriterules after the phpBB3 ones in the phpBB3's .htaccess (when the forum stayed int he same dir after the conversion) with proper paths.

This is of course the kind of matter that require some local testing, but there is nothing hard to do, just things needing to be work before you make the big jump ;)

++
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 4 guests


 
cron