FREE THOUGHT · FREE SOFTWARE · FREE WORLD

Home » Htaccess » Make phpBB SEO friendly with htaccess

Make phpBB SEO friendly with htaccess

Make phpBB SEO friendly with htaccess

November 7th, 2006

After I optimized the caching for my non-dynamic pages using apache modules mod_headers and mod_expires, I began to learn about phpbb seo.. First I used a mod on the forum, where instead of htaccesselite.com/index.php the url is htaccesselite.com/htaccess-vc1.html , and for htaccesselite.com/viewtopic.php?t=5 its htaccesselite.com/caching-using-mod-expires-with-expires-vt5.html


This rewrites internally all .html files to .php

RewriteEngine On
RewriteBase /
RewriteRule (.*).html$ $1.php [L,T=application/x-httpd-php]

Forcing any files to be a certain type of file:

ForceType application/x-httpd-php

Name php files .html

AddType application/x-httpd-php .html

If using phpbb: Removing SID for guests and using phpBB SEO mod rewrites gives you an htaccess like this-

RewriteEngine On
RewriteBase /
RewriteRule ^s/(.*).pl$ /cgi-bin/$1.php [L]
RewriteRule ^htaccess/.+/([^/]+.html)$ /htaccess/index.php [R=301,L]
RewriteRule ^htaccess/.+-vc([0-9]+).html$ /htaccess/index.php?c=$1 [QSA,L]
RewriteRule ^htaccess/.+-vf([0-9]+)-([0-9]+).html$ /htaccess/viewforum.php?f=$1&start=$2 [QSA,L]
RewriteRule ^htaccess/.+-vf([0-9]+).html$ /htaccess/viewforum.php?f=$1 [QSA,L]
RewriteRule ^htaccess/.+-vt([0-9]+)-([0-9]+).html$ /htaccess/viewtopic.php?t=$1&start=$2 [QSA,L]
RewriteRule ^htaccess/.+-vt([0-9]+).html$ /htaccess/viewtopic.php?t=$1 [QSA,L]
RewriteRule ^htaccess/post([0-9]+).html$ /htaccess/viewtopic.php?p=$1 [QSA,L]
RewriteRule ^htaccess/member([0-9]+).html$ /htaccess/profile.php?mode=viewprofile&u=$1 [QSA,L]

Now my question after doing all this to get my phpbb forum optimized is: Do search engines care about the "expires, etag, last-modification, and cache-control headers?" I can't find any information about creating real static pages from phpbb, so that apache can create the etag headers and last-modification headers automatically. I can't even get mod_headers to work with phpbb.

It stands to reason that crawlers would record the last-modified time to display time-based results, so how do they look upon pages that don't have any of these headers?

At this point I am just going to modify the page_header.php file to generate my own Last-modified and expires and cache-control headers and I will experiment with creating an etag.. the md5 function isn't very effiecient though.. I think I'll just start out by giving the expire and last-modified times to expire 10 minutes after requesting the file.. I also want to try and base the last-modified time off of the last post or edit to the data on the page.. what a nightmare! Anyone have any suggestions? I'm googled out at this point..


Please Comment!

Your email address is not saved.

Reader Comments

  1. kees ~April 20, 2010 @ 7:08 pm

    Hey

    Really glad to find this page... awesome!

  2. David ~March 7, 2010 @ 6:52 pm

    Hello,

    you haven't mentioned the phpBB version this information applies to.
    And there is no any dates just to estimate possible board version.

    I would like to implement your tutorial, so could you please specify version #?

    All the best,
    Dave

  3. Math ~October 11, 2009 @ 12:25 pm

    Hi,

    In my server i have redirected a page using following rule

    RewriteEngine on
    RewriteCond %{REQUEST_URI} ^/(.*).html$
    RewriteRule ^(-[a-z]).html$ /tut/page.php?name=$1 [L]

    The file have to be accessed using /site-dir/article-name.html but the url displays the redirection as /tut/page.php?name=article-name

  4. Corey ~October 23, 2008 @ 9:00 pm

    i am tryin to get my phpbb forums optimized but was thinking along a lil bit of a different line, here is what i have....

    I have a community website....and then i have phpbb forums install seperately....so i have these as my links...

    example.com
    and
    example.com/forums

    i have the forums wrapped inside the community site using a iframe function and gives me this link to access it.. example.com/forums.php, but here is my problem- if someone searches on a search engine for something that is in my forums.... and then they click the link in the search engine, it will take them to the forums page without the wrap of the community site. Is there anyway i can use some kind of command to tell it to take them to the forums.php file so that the site is wrapped around it?

    i have searched around here but never messed with .htaccess files before and pretty much loses me every forum i read...thx

  5. xztheericzx ~November 8, 2007 @ 1:47 pm

    i'm eric. joining a couple boards and looking
    forward to participating. hehe unless i get
    too distracted!

    eric

  6. AskApache ~November 1, 2007 @ 10:51 pm

    @ kimopuluo

    I can hardly put myself in such a newbies position as you, I wish you luck! I use the free phpbb.

    And remember that Google is your best friend on the net.

  7. kimopuluo ~October 25, 2007 @ 1:13 pm

    Hello !
    Sorry to bother you. I found this forum when looking through google for forums to use. I need
    to install a forum on my website but I cannot find where it is sold.

    Where did you get this one

    Thanks for any assistance


It's very simple - you read the protocol and write the code. -Bill Joy

Except where otherwise noted, content on this site is licensed under a Creative Commons Attribution 3.0 License, just credit with a link.
This site is not supported or endorsed by The Apache Software Foundation (ASF). All software and documentation produced by The ASF is licensed. "Apache" is a trademark of The ASF. NCSA HTTPd.
UNIX ® is a registered Trademark of The Open Group. POSIX ® is a registered Trademark of The IEEE.

Site Map | Contact Webmaster | Glossary | License and Disclaimer | Terms of Service |

↑ TOPMain