[solved] virtual root

phpBB3 SEO Advanced mod Rewrite support forum.
This mods performs URL rewriting for phpBB, injecting forums and topic titles in their URLs.

Moderator: Moderators

[solved] virtual root

Postby alex13410 » Sun Jan 08, 2012 4:12 pm

hello,
now my url of topics are site.com/forum/topic-title-txx.html and I would like to be site.com/topic-title-txx.html
If I understand with virtual root, url of the index would be site.com/forum.html and not site.com/forum/ ?
I would like to keep site.com/forum/ for the url of the index, and site.com/forum/forum1.html for the url of the different forum.
is there a solution via the htacess, to keep monsite.com/forum/ and site.com/forum/forum1.html while redirecting monsite.com/forum/topic-title-txx.html to site.com/topic-title-txx.html ?
thank you in advance for your answers (excuse me for my bad english, I am french).
Last edited by alex13410 on Tue Jan 10, 2012 4:33 pm, edited 1 time in total.
mon forum sur le detecteur de metaux http://www.detecteur-de-metaux.com info sur les detecteurs de metaux
alex13410
PR1
PR1
 
Posts: 103
Joined: Mon Apr 12, 2010 5:28 pm

Advertisement

Re: virtual root

Postby coyote » Sun Jan 08, 2012 10:39 pm

OK, I think I understand what you mean. Your phpBB is in a folder called forum and you're using Advanced mode, with virtual folders turned on.

yoursite.com/forum/index.php
yoursite.com/forum/viewtopic.php?f=xx&t=yy

with virtual root:
Index: yoursite.com/forum.html
Topic: yoursite.com/forum-name-fxx/topic-title-tyy.html

without virtual root
Index: yoursite.com/forum/
Topic: yoursite.com/forum/forum-name-fxx/topic-title-tyy.html

If you turn virtual folders off, this is what you'll get:
Index: yoursite.com/forum/
Topic: yoursite.com/forum/topic-title-tyy.html


If I understand you correctly, you want this:
Index: yoursite.com/forum/
Topic: yoursite.com/topic-title-tyy.html

Is that correct? If so, I think it will require some kind of edit in phpbb_seo_class.php, but I'm not sure where.

Aussi, nous parlons français (mais pas bien pour moi). ;)
coyote
phpBB SEO Team
phpBB SEO Team
 
Posts: 284
Joined: Fri May 11, 2007 6:24 am

Re: virtual root

Postby coyote » Sun Jan 08, 2012 11:50 pm

I've fiddled with it a lot, and the closest I can come up with is

Advanced ON
Virtual Folders OFF
Virtual Root ON
Zero Dupe ON
Strict Mode OFF

gives you

yoursite.com/forum.html (yoursite.com/forum/ will redirect to forum.html)
yoursite.com/topic-title-tyy.html


I've tried all sorts of things to get the generated link to the index page be "forum/" instead of "forum.html". For now I'm giving up.
coyote
phpBB SEO Team
phpBB SEO Team
 
Posts: 284
Joined: Fri May 11, 2007 6:24 am

Re: virtual root

Postby alex13410 » Mon Jan 09, 2012 7:00 am

yes your totally right, my phpbb forum is in a folder named forum.
so I understand that you tried to do what I would like to do and that it's seems to be impossible at this time.
I have several questions about the virtual root option because I am thinking about turn it ON, but I don't really understand what I have to do:

1-with virtual root ON, can I have also strict mode ON (I ask because in your exemple strict mode is OF)?

2-sould I have to do something to redirect mysite.com/forum/ to mysite.com/forum.html ?

3-should I have to create myself forum.html?

4-should I have to reset and resynchronize the url?

thank you for your answer.
mon forum sur le detecteur de metaux http://www.detecteur-de-metaux.com info sur les detecteurs de metaux
alex13410
PR1
PR1
 
Posts: 103
Joined: Mon Apr 12, 2010 5:28 pm

Re: virtual root

Postby coyote » Mon Jan 09, 2012 8:09 am

alex13410 wrote:yes your totally right, my phpbb forum is in a folder named forum.
so I understand that you tried to do what I would like to do and that it's seems to be impossible at this time.
I have several questions about the virtual root option because I am thinking about turn it ON, but I don't really understand what I have to do:


It's really easy, just turn virtual root on in the ACP.

alex13410 wrote:1-with virtual root ON, can I have also strict mode ON (I ask because in your exemple strict mode is OF)?


Yes, strict mode is OK to be on. :)

alex13410 wrote:2-sould I have to do something to redirect mysite.com/forum/ to mysite.com/forum.html ?


No, it will get redirected automatically.

alex13410 wrote:3-should I have to create myself forum.html?


No, it automatically changes index.php to forum.html when you turn on virtual root.

alex13410 wrote:4-should I have to reset and resynchronize the url?


Nope, just turn it on and let it go! :mrgreen:

alex13410 wrote:thank you for your answer.


You're very welcome. ^^
coyote
phpBB SEO Team
phpBB SEO Team
 
Posts: 284
Joined: Fri May 11, 2007 6:24 am

Re: virtual root

Postby alex13410 » Tue Jan 10, 2012 1:42 pm

thank your for your help :wink:
mon forum sur le detecteur de metaux http://www.detecteur-de-metaux.com info sur les detecteurs de metaux
alex13410
PR1
PR1
 
Posts: 103
Joined: Mon Apr 12, 2010 5:28 pm

Re: virtual root

Postby alex13410 » Tue Jan 10, 2012 2:21 pm

I have big problem, now my phorum doesn't work so I have closed it for the moment.
I select virtual root and generate the new htaccess but I had a error message (the page forum.html doesn't existe) so I select virtual root no and generate a new htaccess and now all my forum give an 404 error.
mon forum sur le detecteur de metaux http://www.detecteur-de-metaux.com info sur les detecteurs de metaux
alex13410
PR1
PR1
 
Posts: 103
Joined: Mon Apr 12, 2010 5:28 pm

Re: virtual root

Postby coyote » Tue Jan 10, 2012 3:43 pm

You need to as well upload the correct .htaccess

forum.html does exist, it's index.php rewritten as forum.html

This .htaccess is meant to go in the site root, not the forum root. For example, yoursite.com/.htaccess, not yoursite.com/forum/.htaccess
Code: Select all
# Lines That should already be in your .htacess
<Files "config.php">
Order Allow,Deny
Deny from All
</Files>
<Files "common.php">
Order Allow,Deny
Deny from All
</Files>

# You may need to un-comment the following lines
# Options +FollowSymlinks
# To make sure that rewritten dir or file (/|.html) will not load dir.php in case it exist
# Options -MultiViews
# REMEBER YOU ONLY NEED TO STARD MOD REWRITE ONCE
RewriteEngine On
# Uncomment the statement below if you want to make use of
# HTTP authentication and it does not already work.
# This could be required if you are for example using PHP via Apache CGI.
# RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]
# REWRITE BASE
RewriteBase /
# HERE IS A GOOD PLACE TO FORCE CANONICAL DOMAIN
# RewriteCond %{HTTP_HOST} !^virtual\.wickedmedia\.org$ [NC]
# RewriteRule ^(.*)$ http://virtual.wickedmedia.org/$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 ^forum\.html$ /forum/index.php [QSA,L,NC]
# FORUM ALL MODES
RewriteRule ^(forum|[a-z0-9_-]*-f)([0-9]+)(-([0-9]+))?\.html$ /forum/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$ /forum/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$ /forum/viewtopic.php?forum_uri=$1&t=$3&start=$5 [QSA,L,NC]
# PHPBB FILES ALL MODES
RewriteRule ^resources/[a-z0-9_-]+/(thumb/)?([0-9]+)$ /forum/download/file.php?id=$2&t=$1 [QSA,L,NC]
# PROFILES THROUGH USERNAME
RewriteRule ^member/([^/]+)/?$ /forum/memberlist.php?mode=viewprofile&un=$1 [QSA,L,NC]
# USER MESSAGES THROUGH USERNAME
RewriteRule ^member/([^/]+)/(topics|posts)/?(page([0-9]+)\.html)?$ /forum/search.php?author=$1&sr=$2&start=$4 [QSA,L,NC]
# GROUPS ALL MODES
RewriteRule ^(group|[a-z0-9_-]*-g)([0-9]+)(-([0-9]+))?\.html$ /forum/memberlist.php?mode=group&g=$2&start=$4 [QSA,L,NC]
# POST
RewriteRule ^post([0-9]+)\.html$ /forum/viewtopic.php?p=$1 [QSA,L,NC]
# ACTIVE TOPICS
RewriteRule ^active-topics(-([0-9]+))?\.html$ /forum/search.php?search_id=active_topics&start=$2&sr=topics [QSA,L,NC]
# UNANSWERED TOPICS
RewriteRule ^unanswered(-([0-9]+))?\.html$ /forum/search.php?search_id=unanswered&start=$2&sr=topics [QSA,L,NC]
# NEW POSTS
RewriteRule ^newposts(-([0-9]+))?\.html$ /forum/search.php?search_id=newposts&start=$2&sr=topics [QSA,L,NC]
# UNREAD POSTS
RewriteRule ^unreadposts(-([0-9]+))?\.html$ /forum/search.php?search_id=unreadposts&start=$2 [QSA,L,NC]
# THE TEAM
RewriteRule ^the-team\.html$ /forum/memberlist.php?mode=leaders [QSA,L,NC]
# HERE IS A GOOD PLACE TO ADD OTHER PHPBB RELATED REWRITERULES

# 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$ /forum/viewforum.php?forum_uri=$1&start=$3 [QSA,L,NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([a-z0-9_-]+)\.html$ /forum/viewforum.php?forum_uri=$1 [QSA,L,NC]
# FIX RELATIVE PATHS : FILES
RewriteRule ^forum/.+/(style\.php|ucp\.php|mcp\.php|faq\.php|download/file.php)$ /forum/$1 [QSA,L,NC,R=301]
# FIX RELATIVE PATHS : IMAGES
RewriteRule ^forum/.+/(styles/.*|images/.*)/$ /forum/$1 [QSA,L,NC,R=301]
# END PHPBB PAGES
#####################################################

my .htaccess (this exact one here, which will also work on your forum) is in virtual.wickedmedia.org/.htaccess

virtual.wickedmedia.org/forum/index.php rewrites to
virtual.wickedmedia.org/forum.html

virtual.wickedmedia.org/forum/viewtopic.php?f=2&t=1 rewrites to
virtual.wickedmedia.org/welcome-phpbb3-t1.html
coyote
phpBB SEO Team
phpBB SEO Team
 
Posts: 284
Joined: Fri May 11, 2007 6:24 am

Re: virtual root

Postby alex13410 » Tue Jan 10, 2012 4:32 pm

I have to tell you a great thank you for your help.
you was right, I make a mystake because the htaccess was in the forum root. now the htaccess is in the site root and everything works perfectly.
thank you again :)
mon forum sur le detecteur de metaux http://www.detecteur-de-metaux.com info sur les detecteurs de metaux
alex13410
PR1
PR1
 
Posts: 103
Joined: Mon Apr 12, 2010 5:28 pm


Return to Advanced SEO URL

 


  • Related topics
    Replies
    Views
    Last post

Who is online

Users browsing this forum: No registered users and 7 guests