MyBB Community Forums

Full Version: Image Links Broken After Admin Directory Name Change
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi all,

I am having a bit of issue with my forum.

I tried changing the name of the Admin directory by changing it in the config.php file as well as the folder name. After this I refreshed the home page of my website and it had broken all of my image links (no logos, icons or background).

In config.php I changed the following line:

$config['admin_dir'] = 'admin';

Then I renamed the folder in my FTP.

Website: https://pavili0n.com

If someone could help with this error it would be great!!
This shouldn't be admin panel related, looks like .htaccess is blocking access to https://pavili0n.com/images/pavili0n1.png and some other files.

Can you post the contents of your .htaccess files, the one in mybb root and the one if the images directory, if any? Can you verify that the files are there and have read permissions?
Images on the entire forum, or just the admin panel?

It's most likely just your cache. Are you using Cloudflare? If so, purge your cache. If not, clear your browsers cache.

Edit: just checked your site (don't normally check sites due to security reasons..) but looks like SentoWeb is correct. I'm getting a Forbidden Error when trying to view images.
(2015-10-07, 08:49 AM)SentoWeb Wrote: [ -> ]This shouldn't be admin panel related, looks like .htaccess is blocking access to https://pavili0n.com/images/pavili0n1.png and some other files.

Can you post the contents of your .htaccess files, the one in mybb root and the one if the images directory, if any? Can you verify that the files are there and have read permissions?

(2015-10-07, 08:49 AM)sparkks Wrote: [ -> ]Images on the entire forum, or just the admin panel?

It's most likely just your cache. Are you using Cloudflare? If so, purge your cache. If not, clear your browsers cache.

Edit: just checked your site (don't normally check sites due to security reasons..) but looks like SentoWeb is correct. I'm getting a Forbidden Error when trying to view images.

Here is the contents of my .htaccess:

RewriteEngine on

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

# Google SEO workaround for search.php highlights:
# Make this rule the first rewrite rule in your .htaccess!
RewriteRule ^([^&]*)&(.*)$ https://pavili0n.com/$1?$2 [L,QSA,R=301]
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

# 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]
RewriteCond %{HTTP_REFERER} !^http://pavili0n.com/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://pavili0n.com$      [NC]
RewriteCond %{HTTP_REFERER} !^http://www.pavili0n.com/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://www.pavili0n.com$      [NC]
RewriteRule .*\.(jpg|jpeg|gif|png|bmp)$ - [F,NC]
Remove the following line from your .htaccess: (the very last line)

RewriteRule .*\.(jpg|jpeg|gif|png|bmp)$ - [F,NC]

I'm not sure what that is exactly.. but I'm not a master when it comes to rewrite rules.. but I do know that it is what's causing your issue.
(2015-10-07, 09:28 AM)sparkks Wrote: [ -> ]Remove the following line from your .htaccess: (the very last line)

RewriteRule .*\.(jpg|jpeg|gif|png|bmp)$ - [F,NC]

I'm not sure what that is exactly.. but I'm not a master when it comes to rewrite rules.. but I do know that it is what's causing your issue.

The "F" flag is causing this, the rewrite group in simple terms:
"If the request is not referred by this website, either the www or non-www version, and this is an image file do nothing with the request but send Forbidden header"

Should solve the issue, not sure what it's purpose is to be honest:
RewriteRule .*\.(jpg|jpeg|gif|png|bmp)$ - [NC]
(2015-10-07, 10:03 AM)SentoWeb Wrote: [ -> ]The "F" flag is causing this, the rewrite group in simple terms:
"If the request is not referred by this website, either the www or non-www version, and this is an image file do nothing with the request but send Forbidden header"

Should solve the issue, not sure what it's purpose is to be honest:
RewriteRule .*\.(jpg|jpeg|gif|png|bmp)$ - [NC]

Thank you for this. I've taken my notes. Smile

You learn something new every day!
(2015-10-07, 09:28 AM)sparkks Wrote: [ -> ]Remove the following line from your .htaccess: (the very last line)

RewriteRule .*\.(jpg|jpeg|gif|png|bmp)$ - [F,NC]

I'm not sure what that is exactly.. but I'm not a master when it comes to rewrite rules.. but I do know that it is what's causing your issue.

(2015-10-07, 10:03 AM)SentoWeb Wrote: [ -> ]
(2015-10-07, 09:28 AM)sparkks Wrote: [ -> ]Remove the following line from your .htaccess: (the very last line)

RewriteRule .*\.(jpg|jpeg|gif|png|bmp)$ - [F,NC]

I'm not sure what that is exactly.. but I'm not a master when it comes to rewrite rules.. but I do know that it is what's causing your issue.

The "F" flag is causing this, the rewrite group in simple terms:
"If the request is not referred by this website, either the www or non-www version, and this is an image file do nothing with the request but send Forbidden header"

Should solve the issue, not sure what it's purpose is to be honest:
RewriteRule .*\.(jpg|jpeg|gif|png|bmp)$ - [NC]

Removing the 'F' worked! Thank you both very much Smile
Can an admin please delete my account.