| |
|
| :: |
| Author |
Message |
auxuser
Joined: 02 Nov 2007 Posts: 2
|
Posted: Fri Jun 13, 2008 1:11 pm Post subject: Switching from another SEO mod with a forum in a subfolder |
|
|
Hello,
I need an advice about writing the new .htaccess or robots file with AMR, please.
At the moment we have a PHPBB2 forum (v. 2.0.23) with an old SEO mod, that doesn't work anymore after the last upgrading. The forum is in a subfolder named /forum/.
The current SEO mod rewrites the addresses using the following .htaccess (placed in the same subdirectory of the forum)
| Code: |
RewriteEngine On
RewriteRule [.]*-vf([0-9]*) viewforum.php?%{QUERY_STRING}&f=$1
RewriteRule [.]*-vp([0-9]*) viewtopic.php?%{QUERY_STRING}&p=$1
RewriteRule [.]*-vt([0-9]*) viewtopic.php?%{QUERY_STRING}&t=$1
|
Now, we have decided to reinstall the forum (PHPBB2) from scratch and to use SEO Advanced Mod Rewrite (v. 2.0.4), Advanced
Zero duplicated, etc.
It's in the subfolder /tmp.forum/ (only for a test purpose) and uses this .htaccess, file placed this time in the root directory of the site.
| Code: |
RewriteEngine On
Redirect permanent /f/ http://www.MY.DOMAIN/forum/
Redirect permanent /default.htm http://www.MY.DOMAIN/
#########################################################
# PHPBB SEO REWRITE RULES #
#########################################################
# FORUM INDEX (un-comment if used)
# RewriteRule ^tmp.forum/index\.html$ /tmp.forum/index.php [QSA,L,NC]
# FORUM PROTECTION RULE
RewriteRule ^tmp.forum/[a-z0-9_-]*/([^/]+\.html)$ /tmp.forum/index.php [R=301,L,NC]
# CATEGORIES
RewriteRule ^tmp.forum/[a-z0-9_-]*-c([0-9]+)\.html$ /tmp.forum/index.php?c=$1 [QSA,L,NC]
# PAGINATED FORUM
RewriteRule ^tmp.forum/[a-z0-9_-]*-f([0-9]+)-([0-9]+)\.html$ /tmp.forum/viewforum.php?f=$1&start=$2 [QSA,L,NC]
# FORUM
RewriteRule ^tmp.forum/[a-z0-9_-]*-f([0-9]+)\.html$ /tmp.forum/viewforum.php?f=$1 [QSA,L,NC]
# PAGINATED TOPIC
RewriteRule ^tmp.forum/[a-z0-9_-]*-t([0-9]+)-([0-9]+)\.html$ /tmp.forum/viewtopic.php?t=$1&start=$2 [QSA,L,NC]
# TOPIC
RewriteRule ^tmp.forum/[a-z0-9_-]*-t([0-9]+)\.html$ /tmp.forum/viewtopic.php?t=$1 [QSA,L,NC]
# POST
RewriteRule ^tmp.forum/post([0-9]+)\.html$ /tmp.forum/viewtopic.php?p=$1 [QSA,L,NC]
#PROFILES
RewriteRule ^tmp.forum/member([0-9]+)\.html$ /tmp.forum/profile.php?mode=viewprofile&u=$1 [QSA,L,NC]
# END PHPBB PAGES
#####################################################
#
# Rules Joomla!
#
#RewriteCond %{REQUEST_URI} ^(/component/option,com) [NC,OR]
RewriteCond %{REQUEST_FILENAME} !\.(jpg|jpeg|gif|png|css|js|pl|txt)$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*) index.php
########## Begin - Rewrite rules to block out some common exploits
## If you experience problems on your site block out the operations listed below
## This attempts to block the most common type of exploit `attempts` to Joomla!
#
# Block out any script trying to set a mosConfig value through the URL
RewriteCond %{QUERY_STRING} mosConfig_[a-zA-Z_]{1,21}(=|\%3D) [OR]
# Block out any script trying to base64_encode crap to send via URL
RewriteCond %{QUERY_STRING} base64_encode.*\(.*\) [OR]
# Block out any script that includes a <script> tag in URL
RewriteCond %{QUERY_STRING} (\<|%3C).*script.*(\>|%3E) [NC,OR]
# Block out any script trying to set a PHP GLOBALS variable via URL
RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]
# Block out any script trying to modify a _REQUEST variable via URL
RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2}) [OR]
# Block out any script trying to execute an extern script in the URL
RewriteCond %{QUERY_STRING} http [OR]
RewriteCond %{QUERY_STRING} ftp
# Send all blocked request to homepage with 403 Forbidden error!
RewriteRule ^(.*)$ index.php [F,L]
#
########## End - Rewrite rules to block out some common exploits
|
In the /robots file we have at the moment
| Code: |
User-agent: *
Disallow: /administrator/
Disallow: /cache/
Disallow: /components/
Disallow: /editor/
Disallow: /help/
Disallow: /images/
Disallow: /includes/
Disallow: /language/
Disallow: /mambots/
Disallow: /media/
Disallow: /modules/
Disallow: /templates/
Disallow: /installation/
Disallow: /forum/posting.php
Disallow: /forum/groupcp.php
Disallow: /forum/search.php
Disallow: /forum/login.php
Disallow: /forum/privmsg.php
Disallow: /forum/post
Disallow: /forum/member
Disallow: /forum/profile.php
Disallow: /forum/memberlist.php
Disallow: /forum/faq.php
Disallow: /tmp.forum/
|
The new, temporary forum+advanced-SEO-rewrite-mod works very well, but what rules we have to add to those files to keep our previously indexed pages? Obviously, we'll rename /tmp.forum/ to /forum/ at the end...
Thank you very much. |
|
|
| Back to top |
|
 |
|
 |
SeO Administrateur - Site Admin

Joined: 15 Mar 2006 Posts: 3482
|
Posted: Fri Jun 13, 2008 1:31 pm Post subject: Re: Switching from another SEO mod with a forum in a subfolder |
|
|
In you r case, since you'll be at the end using the same directory name (forum/), it will be very easy.
Just replace :
with :
and :
with
all occurrences in your .htaccess, and then add :
| Code: | #old post urls :
RewriteRule ^tmp.forum/[a-z0-9_-]*-vp([0-9]+)\.html?$ /tmp.forum/viewtopic.php?p=$1 [QSA,L,NC] |
You'll off course need to replace all occurrence of tmp.forum/ with forum/ when you'll switch for real.
Then, you'll need the zero duplicate mod to properly perform the required redirections.
If you wish, you can as well keep the same url for forums and topics, you'd just need to replace -f and -t with -vf and -vt (without the question marks this time) and add the same rewriterule for posts. Additonally you'd need to perform the same replacement (-f and -t => -vf and -vt) in phpbb_seo/phpbb_seo_class.php :
| Code: | 'forum' => '-f',
'topic' => '-t', |
Doing this would save some redirecting, but you'd still need the zero duplicate mod for post urls.
Another thing you could do would be to convert to phpBB3 directly
Robots.txt is ok
++ |
_________________ phpBB SEO || SEO Forum || Forum Référencement
GYM Sitemap & RSS for phpBB3 has been released ! || GYM Sitemap & RSS for phpBB3 est disponible ! |
|
| Back to top |
|
 |
auxuser
Joined: 02 Nov 2007 Posts: 2
|
Posted: Fri Jun 13, 2008 9:24 pm Post subject: Re: Switching from another SEO mod with a forum in a subfolder |
|
|
Hi SeO,
| SeO wrote: | | In you r case, since you'll be at the end using the same directory name (forum/), it will be very easy. |
Thank you very much for the timely and kind answer.
All works perfectly: the pages indexed by google, etc are all correctly redirected.
| Quote: |
Then, you'll need the zero duplicate mod to properly perform the required redirections. |
I did it, thanks.
| Quote: |
Another thing you could do would be to convert to phpBB3 directly
|
Unfortunately, we have installed a couple of custom MOD, and at the moment no idea how to port them to phpBB3. But we'll convert the board as soon as possible.
Thanks again for all. This site has a great support!  |
|
|
| Back to top |
|
 |
|
| Navigation |
Similar Topics |
|
|
|
|
|
|
|