| |
| |
|
|
|
|
| |
|
| |
|
| :: |
| Author |
Message |
MarcoPolo
Joined: 16 Jul 2008 Posts: 2
|
Posted: 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

Joined: 15 Mar 2006 Posts: 3477
|
Posted: 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
|
Posted: 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
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

Joined: 15 Mar 2006 Posts: 3477
|
|
| Back to top |
|
 |
|
| Navigation |
Similar Topics |
|
|
|
|
|
|
|
| |
|
|
|
|
| |
|
|
|
|
| |