MyBB Community Forums

Full Version: Troubleshooting Search Engine Friendly URL's
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I'm searching for various terms through the site search and through Google but I cannot seem to locate a thread that covers troubleshooting search engine friendly urls.

Can someone point me to a troubleshooting thread?

Current setup:
MyBB: 1.4.9
PHP: 5.2.11
MySQL: 5.0.81
Hosting 1&1 shared hosting (linux)
Forum resides on a subdomain (forum.)

Steps taken
I renamed the .htaccess file, nothing happened.
I changed the SEF setting from auto to enabled and I get a 404 page.
Check that your host supports mod_rewrite; if you've renamed htaccess.txt to .htaccess, enabled the setting, as long as settings.php is CHMOD to 666 to make the settings save, it should work, if mod_rewrite is supported.
My phpinfo file doesn't list mod-rewrite. However, according to 1and1 I do have mod rewrite enabled. I also have a Drupal site on the same account and it recognizes mod rewrite and is displaying clean urls.

I went through and doubled checked all chmod settings according to the installation help file and I ensured that settings.php was set to 666.

404's remain.
I found the solution with a little more digging. I want to thank BigFraggle for posting the solution on this thread.

Put this code in your .htaccess file at the end of the rewrite lines.

RewriteBase /

I was confused with clean url's because a Drupal site I have on the same server has no problems. I double checked and the Drupal .htaccess contains this line. I'm not sure if it changes anything else perhaps this should be added to the next maintenance release.

Here is my full rewrite lines.

<IfModule mod_rewrite.c>
	RewriteEngine on
	RewriteRule ^forum-([0-9]+)\.html$ forumdisplay.php?fid=$1 [L,QSA]
	RewriteRule ^forum-([0-9]+)-page-([0-9]+)\.html$ forumdisplay.php?fid=$1&page=$2 [L,QSA]

	RewriteRule ^thread-([0-9]+)\.html$ showthread.php?tid=$1 [L,QSA]
	RewriteRule ^thread-([0-9]+)-page-([0-9]+)\.html$ showthread.php?tid=$1&page=$2 [L,QSA]
	RewriteRule ^thread-([0-9]+)-lastpost\.html$ showthread.php?tid=$1&action=lastpost [L,QSA]
	RewriteRule ^thread-([0-9]+)-nextnewest\.html$ showthread.php?tid=$1&action=nextnewest [L,QSA]
	RewriteRule ^thread-([0-9]+)-nextoldest\.html$ showthread.php?tid=$1&action=nextoldest [L,QSA]
	RewriteRule ^thread-([0-9]+)-newpost\.html$ showthread.php?tid=$1&action=newpost [L,QSA]
	RewriteRule ^thread-([0-9]+)-post-([0-9]+)\.html$ showthread.php?tid=$1&pid=$2 [L,QSA]

	RewriteRule ^post-([0-9]+)\.html$ showthread.php?pid=$1 [L,QSA]

	RewriteRule ^announcement-([0-9]+)\.html$ announcements.php?aid=$1 [L,QSA]

	RewriteRule ^user-([0-9]+)\.html$ member.php?action=profile&uid=$1 [L,QSA]

	RewriteRule ^calendar-([0-9]+)\.html$ calendar.php?calendar=$1 [L,QSA]
	RewriteRule ^calendar-([0-9]+)-year-([0-9]+)\.html$ calendar.php?action=yearview&calendar=$1&year=$2 [L,QSA]
	RewriteRule ^calendar-([0-9]+)-year-([0-9]+)-month-([0-9]+)\.html$ calendar.php?calendar=$1&year=$2&month=$3 [L,QSA]
	RewriteRule ^calendar-([0-9]+)-year-([0-9]+)-month-([0-9]+)-day-([0-9]+)\.html$ calendar.php?action=dayview&calendar=$1&year=$2&month=$3&day=$4 [L,QSA]
	RewriteRule ^calendar-([0-9]+)-week-(n?[0-9]+)\.html$ calendar.php?action=weekview&calendar=$1&week=$2 [L,QSA]

	RewriteRule ^event-([0-9]+)\.html$ calendar.php?action=event&eid=$1 [L,QSA]
  
  RewriteBase /

	<IfModule mod_env.c>
		SetEnv SEO_SUPPORT 1
	</IfModule>
</IfModule>