Forum Moderators: coopster

Message Too Old, No Replies

Help needed with rewriting URL's for phpBB forum

Querying the database from .htaccess

         

spietreser

10:43 am on Jun 27, 2003 (gmt 0)

10+ Year Member



Hello WebmasterWorld,

I have seen phpBB forums with static looking pages getting spidered by search engines. I believe the rewriting of the URL is done with mod_rewrite from Apache servers.

Is it possible to rewrite the URL in such a way that the thread topic will be seen as the filename of the page? I would think that querying the database from the .htaccess file is needed? So the URL for a particular thread would then be:
[example.com...]
instead of
[example.com...]

Any help would be GREATLY appreciated!

Thanks

jatar_k

4:01 pm on Jun 27, 2003 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



I don't believe you can query a db from htaccess. What is normally done is that the thread number is the filename.

so they would end up something like
http://www.example.com/phpBB/646525.htm

this thread covers basics
An Introduction to Redirecting URLs on an Apache Server [webmasterworld.com]

vincevincevince

6:50 pm on Jun 27, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



i'd use a custom 404 trick

set your 404 page to a php page

output headers from the 404 page to say 200 OK

query the database for the requested url = title of thread

return page in normal way

jamie

6:58 pm on Jun 27, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



we installed the google-mod for our phpbb forum (which gets rid of session ids for google, slurp and other bots, allowing them to spider)

and as of 2 months ago, googlebot has gone mad in our forum - been spidering and indexing LOADS.

has nothing to do with the dynamic / static URLs, simply with the mod which we installed.

well worth investigating!

jatar_k

7:01 pm on Jun 27, 2003 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



I've herad that mod works fairly well also. I actually had forgotten about it, good call jamie. ;)

rogerd

7:03 pm on Jun 27, 2003 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Jatar_k has the right approach, spietrieser, though you may have to figure out how to deal with the session ID in the URL query strings.

There is at least one hack for checking the user agent and eliminating the session ID. If you haven't checked out the discussion of spidering issues at their own forum, do that. Lots of confusion, naturally, but the key things seem to be stripping the session ID and, if you can do it, rewriting the URL.