Jump to the post that solved this thread.
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Solved: 3 Years, 3 Months, 3 Weeks ago htaccess error along with SEO URLs error
#1
Solved: 3 Years, 3 Months, 3 Weeks ago
Hello,

I'm having some issues gettings the SEO Friendly URLs to work along with redirecting my forum's homepage to the portal. I'll start with detailing my issue with SEO URLs.

My current .htaccess contains the following:
Options -MultiViews +FollowSymlinks -Indexes

#
# If mod_security is enabled, attempt to disable it.
# - Note, this will work on the majority of hosts but on
#   MediaTemple, it is known to cause random Internal Server
#   errors. For MediaTemple, please remove the block below
#
<IfModule mod_security.c>
    # Turn off mod_security filtering.
    SecFilterEngine Off

    # The below probably isn't needed, but better safe than sorry.
    SecFilterScanPOST Off
</IfModule>

#
# MyBB "search engine friendly" URL rewrites
# - Note, for these to work with MyBB please make sure you have
#   the setting enabled in the Admin CP and you have this file
#   named .htaccess
#
<IfModule mod_rewrite.c>
    RewriteEngine on
	RewriteBase /
    DirectoryIndex portal.php
    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]

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

#
# If Apache is compiled with built in mod_deflade/GZIP support
# then GZIP Javascript, CSS, HTML and XML so they're sent to
# the client faster.
#
<IfModule mod_deflate.c>
    AddOutputFilterByType DEFLATE application/javascript text/css text/html text/xml
</IfModule>

I have checked my loaded modules and can confirm that I do have "mod_rewrite" loaded so that's not the issue. My forums is in the main directory and not a sub folder meaning RewriteBase shouldn't be the issue here either. I have also checked mod_security and can confirm that it isn't loaded. I have checked my error log and I'm only receiving "File does not exist" errors, I'll leave some examples of the errors below:

[Tue May 24 02:33:26 2016] [error] [client IPADDRESS(I've removed this IP)] PHP Warning:  phpinfo(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in /var/www/html/ModRewrite.php on line 2
[Tue May 24 02:34:17 2016] [error] [client IPADDRESS(I've removed this IP)] File does not exist: /var/www/html/images/usercp/options.gif, referer: http://forums.universalplayground.uk/admin/index.php?module=config-plugins
[Tue May 24 02:34:17 2016] [error] [client IPADDRESS(I've removed this IP)] File does not exist: /var/www/html/admin/styles/default/images/icons/error.gif, referer: http://forums.universalplayground.uk/admin/index.php?module=config-plugins
[Tue May 24 02:34:17 2016] [error] [client IPADDRESS(I've removed this IP)] File does not exist: /var/www/html/admin/styles/default/images/icons/warning.gif, referer: http://forums.universalplayground.uk/admin/index.php?module=config-plugins
[Tue May 24 02:34:17 2016] [error] [client IPADDRESS(I've removed this IP)] File does not exist: /var/www/html/admin/styles/default/images/icons/success.gif, referer: http://forums.universalplayground.uk/admin/index.php?module=config-plugins
[Tue May 24 02:34:17 2016] [error] [client IPADDRESS(I've removed this IP)] File does not exist: /var/www/html/admin/styles/default/images/icons/custom.gif, referer: http://forums.universalplayground.uk/admin/index.php?module=config-plugins
[Tue May 24 02:34:21 2016] [error] [client IPADDRESS(I've removed this IP)] File does not exist: /var/www/html/images/usercp/options.gif, referer: http://forums.universalplayground.uk/admin/index.php?module=config-plugins
[Tue May 24 02:34:26 2016] [error] [client IPADDRESS(I've removed this IP)] File does not exist: /var/www/html/images/usercp/options.gif, referer: http://forums.universalplayground.uk/admin/index.php?module=config-plugins
[Tue May 24 02:34:32 2016] [error] [client IPADDRESS(I've removed this IP)] File does not exist: /var/www/html/images/usercp/options.gif, referer: http://forums.universalplayground.uk/admin/index.php?module=config-plugins
[Tue May 24 02:34:34 2016] [error] [client IPADDRESS(I've removed this IP)] File does not exist: /var/www/html/images/usercp/options.gif, referer: http://forums.universalplayground.uk/admin/index.php?module=config-plugins
[Tue May 24 02:36:04 2016] [error] [client IPADDRESS(I've removed this IP)] File does not exist: /var/www/html/forum-2.html, referer: http://forums.universalplayground.uk/index.php
[Tue May 24 02:37:37 2016] [error] [client IPADDRESS(I've removed this IP)] File does not exist: /var/www/html/forum-2.html, referer: http://forums.universalplayground.uk/index.php
[Tue May 24 02:37:38 2016] [error] [client IPADDRESS(I've removed this IP)] File does not exist: /var/www/html/forum-2.html, referer: http://forums.universalplayground.uk/index.php

Onto my Portal issue now, as you can see from my .htaccess I have "DirectoryIndex portal.php" included however it simply doesn't work and I'm unsure if these issues are related.

When I enable SEO Friendly URL's I simply get "Not Found The requested URL was not found on this server" upon clicking any of my forums.

Test Forum Link:  http://forums.universalplayground.uk 

Any help at all is greatly appreciated, thanks.
Reply
#2
Solved: 3 Years, 3 Months, 3 Weeks ago
contact your web host and ask whether mod_rewrite is not functioning due to incorrect timezone.
most probably your web host has to fix it.
Reply
#3
Solved: 3 Years, 3 Months, 3 Weeks ago
(05-24-2016, 01:36 PM).m. Wrote: contact your web host and ask whether mod_rewrite is not functioning due to incorrect timezone.
most probably your web host has to fix it.

I'm hosting this on a dedicated server running Centos 6.6 so I'm not sure my provider will assist me with queries like this since I installed Apache onto the box myself, I believe they will only support technical issues with the server itself. 

Could you advise on what to do to rectify this issue?
Reply
#4
Solved: 3 Years, 3 Months, 3 Weeks ago
^ php configuration (file => php.ini) should have correct time zone setting (eg.#)
Reply
#5
Solved: 3 Years, 3 Months, 3 Weeks ago
I've rectified the timezone issue so it is now Europe/London (the same as my dedi) however I'm still seeing the errors mentioned above so I don't think the timezone problem was the cause. Any further suggestions I can try?
Reply
#6
Solved: 3 Years, 3 Months, 3 Weeks ago
Don't use the servers time - set it manually in your MyBB installation.
[Image: kAhpvOW.png]
Reply
#7
Solved: 3 Years, 3 Months, 3 Weeks ago
(05-25-2016, 07:56 AM)Ben Cousins Wrote: Don't use the servers time - set it manually in your MyBB installation.

I already have got my forum time setup manually to GMT with Day Light Saving on "Yes" so my forum time should have always been correct, it was just my PHP time that was set incorrectly.

Any suggestions on how I can fix this issue?
Reply
#8
Solved: 3 Years, 3 Months, 3 Weeks ago
^ is the error referring mod_rewrite & time disappeared from the error log?
Reply
#9
Solved: 3 Years, 3 Months, 3 Weeks ago
(05-25-2016, 08:33 AM).m. Wrote: ^ is the error referring mod_rewrite & time disappeared from the error log?

The time related error has gone now yes, however the "File does not exist" error is what remains. I'll paste the error log from what I just got when clicking through a few forums to generate the error:

[Wed May 25 09:33:24 2016] [error] [client Client IP(I removed IP)] File does not exist: /var/www/html/forum-5.html, referer: http://forums.universalplayground.uk/index.php
[Wed May 25 09:37:34 2016] [error] [client Client IP(I removed IP)] File does not exist: /var/www/html/forum-8.html, referer: http://forums.universalplayground.uk/index.php
[Wed May 25 09:37:37 2016] [error] [client Client IP(I removed IP)] File does not exist: /var/www/html/forum-7.html, referer: http://forums.universalplayground.uk/index.php
[Wed May 25 09:37:39 2016] [error] [client Client IP(I removed IP)] File does not exist: /var/www/html/forum-6.html, referer: http://forums.universalplayground.uk/index.php
[Wed May 25 09:37:41 2016] [error] [client Client IP(I removed IP)] File does not exist: /var/www/html/forum-5.html, referer: http://forums.universalplayground.uk/index.php
[Wed May 25 09:37:43 2016] [error] [client Client IP(I removed IP)] File does not exist: /var/www/html/forum-11.html, referer: http://forums.universalplayground.uk/index.php
[Wed May 25 09:37:44 2016] [error] [client Client IP(I removed IP)] File does not exist: /var/www/html/forum-10.html, referer: http://forums.universalplayground.uk/index.php
[Wed May 25 09:37:45 2016] [error] [client Client IP(I removed IP)] File does not exist: /var/www/html/forum-13.html, referer: http://forums.universalplayground.uk/index.php
[Wed May 25 09:38:28 2016] [error] [client Client IP(I removed IP)] File does not exist: /var/www/html/forum-16.html, referer: http://forums.universalplayground.uk/index.php
[Wed May 25 09:38:28 2016] [error] [client Client IP(I removed IP)] File does not exist: /var/www/html/forum-16.html, referer: http://forums.universalplayground.uk/index.php
[Wed May 25 09:38:30 2016] [error] [client Client IP(I removed IP)] File does not exist: /var/www/html/forum-19.html, referer: http://forums.universalplayground.uk/index.php
Reply
#10
Solved: 3 Years, 3 Months, 3 Weeks ago
Can anybody else suggest a potential fix to this issue? If I can't get it sorted I'll just have to deal with keeping SEO URLs disabled but would very much like to get this working.
Reply
Jump to the post that solved this thread.


Forum Jump:


Users browsing this thread: 1 Guest(s)