Redirect forum.html to /

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

Moderator: Moderators

Redirect forum.html to /

Postby tosiek » Fri Feb 20, 2009 11:51 am

Hello. I have question.

How to redirect from example.com/forum.html to example.com/
?
tosiek
 
Posts: 5
Joined: Fri Feb 20, 2009 11:46 am

Advertisement

Postby SeO » Fri Feb 20, 2009 3:32 pm

With our mods it's pretty easy if you are not using the virtual root option, you just have to set no file (no forum.html) for forum index in phpbb_seo_class.php and the zero duplicate will do the appropriate redirect for you.

install wrote:=> By Default, this mod will get rid of index.php for phpBB's index.
You can change this in phpbb_seo/phpbb_seo_class.php if you prefer.
Look for :

'index' => ''

In this line of code :

$this->seo_static = array( 'forum' => 'forum', 'topic' => 'topic', 'post' => 'post', 'user' => 'member', 'group' => 'group', 'index' => '', 'global_announce' => 'announces', 'leaders' => 'the-team', 'atopic' => 'active-topics', 'utopic' => 'unanswered', 'npost' => 'newposts', 'pagination' => 'page', 'gz_ext' => '.gz' );

And replace with :

'index' => 'forum'

or whatever you may prefer.
This is mostly useful if you're running a portal in the folder where phpBB is installed.


If you are using the virtual root option, then it's just not possible, since example.com/ cannot be your forum index.
SeO
Admin
Admin
 
Posts: 6334
Joined: Wed Mar 15, 2006 9:41 pm

Postby tosiek » Fri Feb 20, 2009 6:19 pm

I have phpBB seo Premod, and install gym sitemaps,

this tips doesn't work:
Code: Select all
// Default : Used as URL when format_url would return nothing or with simple URLs
      // can be edited, requires .htaccess update.
      $this->seo_static = array( 'forum' => 'forum', 'topic' => 'topic', 'post' => 'post', 'user' => 'member', 'group' => 'group', 'index' => 'forum', 'global_announce' => 'announces', 'leaders' => 'the-team', 'atopic' => 'active-topics', 'utopic' => 'unanswered', 'npost' => 'newposts', 'pagination' => 'page', 'gz_ext' => '.gz' );
      // URL suffixes, for the phpBB URLs
      // can be edited, requires .htaccess update.
      $this->seo_ext = array( 'forum' => '.html', 'topic' => '.html', 'post' => '.html', 'user' => '.html', 'group' => '.html',  'index' => '', 'global_announce' => '/', 'leaders' => '.html', 'atopic' => '.html', 'utopic' => '.html', 'npost' => '.html', 'pagination' => '.html', 'gz_ext' => '');


I must edit htaccess ?
Code: Select all
RewriteRule ^forum\.html$ ./index.php [QSA,L,NC]
tosiek
 
Posts: 5
Joined: Fri Feb 20, 2009 11:46 am

Postby SeO » Sat Feb 21, 2009 7:56 am

SeO wrote:if you are not using the virtual root option, you just have to set no file (no forum.html) for forum index in phpbb_seo_class.php and the zero duplicate will do the appropriate redirect for you.


The if is important.
The suggested code to eventually change, knowing that by default forum.html is not used (unless you activated virtual root), is only altering the links displayed on the forum for the forum index. You need the zero duplicate to perform the redirect (among many other useful).
SeO
Admin
Admin
 
Posts: 6334
Joined: Wed Mar 15, 2006 9:41 pm

Postby tosiek » Sat Feb 21, 2009 8:23 am

Whether I have a virtual root on or not, it would address the example / forum.html

I have included Zero Duplicate (all options)

My address to the forum http://cs.tosiek.pl

What should I do in order to eventually be the main address /?
tosiek
 
Posts: 5
Joined: Fri Feb 20, 2009 11:46 am

Postby SeO » Sat Feb 21, 2009 8:25 am

You phpBB looks like installed in the domain's root, so you should not even see the virtual root option.
If you do, then it most likely means that your configured script path is wrong in acp.
Make sure you have :
Code: Select all
script path:/
SeO
Admin
Admin
 
Posts: 6334
Joined: Wed Mar 15, 2006 9:41 pm

Re: Redirect forum.html to /

Postby tosiek » Tue Feb 24, 2009 10:26 pm

My configuration:
Image
tosiek
 
Posts: 5
Joined: Fri Feb 20, 2009 11:46 am

Re: Redirect forum.html to /

Postby SeO » Wed Feb 25, 2009 4:56 pm

Your settings are correct, but you have a :
Code: Select all
'index' => 'forum'

in the code you posted here : Redirect forum.html to /

You want both occurrences of index to be empty in these two array to stop from using forum.html as your forum index :
Code: Select all
'index' => ''
SeO
Admin
Admin
 
Posts: 6334
Joined: Wed Mar 15, 2006 9:41 pm

Re: Redirect forum.html to /

Postby tosiek » Fri Feb 27, 2009 12:02 pm

Thanx You :) It's work .
tosiek
 
Posts: 5
Joined: Fri Feb 20, 2009 11:46 am


Return to phpBB mod Rewrite

 


  • Related topics
    Replies
    Views
    Last post

Who is online

Users browsing this forum: No registered users and 9 guests