MyBB Community Forums
Google SEO - wrong rewrite - Printable Version

+- MyBB Community Forums (https://community.mybb.com)
+-- Forum: Extensions (https://community.mybb.com/forum-201.html)
+--- Forum: Plugins (https://community.mybb.com/forum-73.html)
+---- Forum: Plugin Support (https://community.mybb.com/forum-72.html)
+---- Thread: Google SEO - wrong rewrite (/thread-149447.html)



Google SEO - wrong rewrite - RigPa - 2013-12-31

I have my forum installed like this: http://creepysuperzombie.com/forum/

When I look at the Google SEO plugin it says Add to .htaccess:
RewriteEngine on

# Some hosts require RewriteBase to make RewriteRules work.
RewriteBase /forum/

# Google SEO workaround for search.php highlights:
# Make this rule the first rewrite rule in your .htaccess!
RewriteRule ^([^&]*)&(.*)$ http://creepysuperzombie.com/forum/$1?$2 [L,QSA,R=301]

# Google SEO 404:
ErrorDocument 404 /forum/misc.php?google_seo_error=404

# Google SEO Sitemap:
RewriteRule ^sitemap\-([^./]+)\.xml$ misc.php?google_seo_sitemap=$1 [L,QSA,NC]

# Google SEO URL Forums:
RewriteRule ^Forum\-([^./]+)$ forumdisplay.php?google_seo_forum=$1 [L,QSA,NC]

# Google SEO URL Threads:
RewriteRule ^Thread\-([^./]+)$ showthread.php?google_seo_thread=$1 [L,QSA,NC]

# Google SEO URL Announcements:
RewriteRule ^Announcement\-([^./]+)$ announcements.php?google_seo_announcement=$1 [L,QSA,NC]

# Google SEO URL Users:
RewriteRule ^User\-([^./]+)$ member.php?action=profile&google_seo_user=$1 [L,QSA,NC]

# Google SEO URL Calendars:
RewriteRule ^Calendar\-([^./]+)$ calendar.php?google_seo_calendar=$1 [L,QSA,NC]

# Google SEO URL Events:
RewriteRule ^Event\-([^./]+)$ calendar.php?action=event&google_seo_event=$1 [L,QSA,NC]


I click: Click to Apply changes to core files.


It seems that nothing are being written to .htaccess but when I click this every thread in the forum goes to the main 404 error page because of the rewrite - not the forum 404.

Adding the code manually also makes every post in the forum go to 404 page.

Is this plugin not able to handle sub domains?


RE: Google SEO - wrong rewrite - Whiteneo - 2013-12-31

Nop, the core files to make changes are functions.php file, for security reasons you have to write and create your htaccess file or if you have one add manually that data.

The info provided by plugin have to do his job, but even or at most of the cases you have to open your htaccess.txt file of a fresh install and add this things provided by Google SEO plugin, finally you have to upload this file and rename it to .htaccess.

Enable server optimization options for friendly urls, that all and have to work.


RE: Google SEO - wrong rewrite - RigPa - 2013-12-31

I did that manually because it wasn't added when I tried to do it from the panel. After enabling server optimization for friendly urls I get the friendly url's in the address line but the page shown is main page 404. Not even the forum 404 page.

There is something about that rewrite that is not working correctly. It rewrites to the main url (which is a WP installation), not the forum url (www.CreepySuperZombie.com/forum)

If I disable friendly url's it works perfectly with the ugly url's


RE: Google SEO - wrong rewrite - frostschutz - 2013-12-31

It may be that the WP rewrite is taking precedence over the forum ones, in which case you should add a RewriteCond to the WP rewrite rule which makes it ignore all /forum/ URLs.

Something like
RewriteCond %{REQUEST_URI} !^forum/?
RewriteRule . /index.php [L]

Google for wordpress ignore subdir it's a common issue...


RE: Google SEO - wrong rewrite - RigPa - 2013-12-31

Thanks - but how do I do that? Im no expert in Apache.


RE: Google SEO - wrong rewrite - frostschutz - 2013-12-31

http://stackoverflow.com/questions/16283917/wordpress-mod-rewrite-exception-for-a-subdirectory

You'd need to change the WordPress /.htaccess, not the /forum/.htaccess