Forum Moderators: phranque

Message Too Old, No Replies

PHP Forum and Search Engine Friendly URLs

Creating SE friendly PHP forum URLs

         

cantillion

1:57 pm on Aug 31, 2003 (gmt 0)

10+ Year Member



I have a PHP coded forum on a site with a reasonable amount of pages. I've been reading a LOT of fantastically useful information from this site about URL redirection to enable search engine friendly URLs. Not being a techinical wizard, it took me a fair while to sift through this, but I think I'm there.

It seems a neat way of getting Search Engines to index these long query string URLs it to write something along the lines of:

RewriteEngine on
RewriteBase /
RewriteRule ^forum/01/(.*)$

[site-of-forum.co.uk...]

Unfortunatly, when I upload the .htaccess file to my servers, I get a nasty "Internal Server Error". So I figued that the mod_rewrite module isn't loaded - but unfortunately techinical support have come reminded me to read the small print (they don't provide support for their CGI servers).

Ok, not a problem, I'll try this on the main servers on my main site. So I loaded up the same .htaccess file.

So now when I type www.main-site.co.uk/forum/01 I get [site-of-forum.co.uk...] Excellent. Thing is, this means I'd have to write a line in the .htaccess file for every single forum thread.

Or do I? A typcial URL on the forum is: [site-of-forum.co.uk...]

I'm happy to try and alter some PHP if the answer lay there. (Just that I'll actually have to go off and learn PHP first!) All I really want to know is if its possible to het the above URL to be a bit more pretty.

Or shall I just give up and wait for google to crawl my site?

jdMorgan

9:24 pm on Aug 31, 2003 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



cantillion,

Welcome to WebmasterWorld [webmasterworld.com]!

Take a look at this thread [webmasterworld.com], where Anguz appears to be working on a very similar problem.

The trick is to put shortened versions of your script variables into the "visible" URI using slashes instead of "?", "&", etc.

So, you could use something like "http://www.site-of-forum.co.uk/display/comments" for the search-engine- and user-visible URI, and rewrite that back to the form that script requires.

Plan a flexible solution first, and then get into the implementation details.

Jim

cantillion

9:39 pm on Aug 31, 2003 (gmt 0)

10+ Year Member



Thanks for the heads up! Spent a while on this already, so there's no way I'm calling it a day without getting the job done.

Wish me luck ;-)