phpBB SEO
Boards
Directory  
SEO  
Downloads
  phpBB SEO : Search Engine Optimization, Directory, Forums  
Index
Forums
Annuaire
Référencement
Télécharger
 
  Search Rechercher
    Register
Username :  Password :  Log me on automatically each visit  
S'enregistrer  
 
   
Setting a DirectoryIndex in .htaccess

 
Post new topic   Reply to topic    phpBB SEO » SEO Forum  » phpBB3 SEO TooLKit  » phpBB SEO Premod
::  
Author Message
MarcoPolo



Joined: 16 Jul 2008
Posts: 2

Setting a DirectoryIndex in .htaccessPosted: Wed Jul 16, 2008 5:09 pm    Post subject: Setting a DirectoryIndex in .htaccess

I have a question. I use the latest version of "phpBB SEO Premod" with Advanced mod rewrite. I want to use a forum as my index page, so in .htaccess I put the following line:

Code:
DirectoryIndex viewforum.php?f=2


Now when I visit the index page (domain.com) the url shows as:

domain.com/forum-title-f2.html

How to make a rule so that when domain.com is visited, the url will stay as:

domain.com/ (...without "forum-title-f2.html")

Thanks in advance.
Back to top
SeO
Administrateur - Site Admin
Administrateur - Site Admin


Joined: 15 Mar 2006
Posts: 3477

Setting a DirectoryIndex in .htaccessPosted: Wed Jul 16, 2008 10:02 pm    Post subject: Re: Setting a DirectoryIndex in .htaccess

The DirectoryIndex should list all scripts
Code:
DirectoryIndex index.php index.html index.htm


About setting a forum as the index, the problem will the the zero duplicate, since it will force the use of the attended uri example.com/forum-url.html in your case.

But you could circumvent this sort of if you would use index.html or home.html for your forum URL (the one supposed to be the index) and then edit the phpbb_seo_class.php file as explained in the install to use something like forum.html for the real forum index.
You would need to turn of the virtual folder option and activate the forum id removing in the settings.

at this stage example.com/ would still load example.com/index.php (example.com/forum.html with url rewriting), and a DirectoryIndex would not help much since it will only consider real files, but you could implement an extra rewriterule to redirect example.com/ to example.com/index.html (or home.html or whatever you decide for the forum url).

Code:
RewriteRule ^/?$ /index.html [QSA,L,R=301]


before the forum rewriterules and with the proper paths and slashes. This will not work if there is a physical index.html file in the directory, but besides, it should be a way to do what you want.

_________________
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
MarcoPolo



Joined: 16 Jul 2008
Posts: 2

Setting a DirectoryIndex in .htaccessPosted: Thu Jul 17, 2008 1:36 am    Post subject: Re: Setting a DirectoryIndex in .htaccess

That works but all the links that link to the index page {U_INDEX} are now linked to domain.com/forum.html instead of linking to domain.com/ or domain.com/index.html

What if I do the following:

1. Use DirectoryIndex viewforum.php?f=2 in the .htaccess

2. activate the forum id removing in the settings.

3. use index.html for my forum URL

4. in phpbb_seo_class.php use

Code:
'index' => ''

instead of... 'index' => 'forum'

Would this cause any problems? Or I should better do it like you say and then in the templates change {U_INDEX} links with a static link to "index.html"?
Back to top
SeO
Administrateur - Site Admin
Administrateur - Site Admin


Joined: 15 Mar 2006
Posts: 3477

Setting a DirectoryIndex in .htaccessPosted: Thu Jul 17, 2008 9:23 am    Post subject: Re: Setting a DirectoryIndex in .htaccess

You can give it a try for the DirectoryIndex.

For the index link, it is build in the page_header() function in functions.php, you can hard code it there directly.

_________________
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
Display posts from previous:   
Post new topic   Reply to topic    phpBB SEO » SEO Forum  » phpBB3 SEO TooLKit  » phpBB SEO Premod
Page 1 of 1

Navigation Similar Topics

Jump to: