CSS of Admin page not showing up

<%- if @topic_view.topic.tags.present? %>
<%= t 'js.tagging.tags' %>: <%- @topic_view.topic.tags.each do |t| %> <%= t %> <%- end %>
<% end %>

The main page is fine. But the admin styling is not showing up.

When i open this at a browser, it says not found. But i checked the file, it exists. sampledomian.com/vendor/silverstripe/admin/client/dist/styles/bundle.css?m=160222414

Admin page also says Unsupported browser, evenn thought i am using chrome.

Is this an SS4 project and are you using the public folder? You could try running composer vendor-expose.

yes. is is a ss4. i already tried composer vendor-expose. i am also using public folder. but still the css layout for admin page is not showing.

Check you have an .htaccess in the public directory and one in the public folders parent (project root)

i have .htaccess on root and public.

@Jerome_Tan no you wouldn’t want to do that.

What version are you using? I checked a 4.6.1 install I have and this is the .htaccess file contents for the file in /public


### SILVERSTRIPE START ###
# Deny access to templates (but allow from localhost)
<Files *.ss>
    Order deny,allow
    Deny from all
    Allow from 127.0.0.1
</Files>

# Deny access to IIS configuration
<Files web.config>
    Order deny,allow
    Deny from all
</Files>

# Deny access to YAML configuration files which might include sensitive information
<Files ~ "\.ya?ml$">
    Order allow,deny
    Deny from all
</Files>

# Route errors to static pages automatically generated by SilverStripe
ErrorDocument 404 /assets/error-404.html
ErrorDocument 500 /assets/error-500.html

<IfModule mod_rewrite.c>

    # Turn off index.php handling requests to the homepage fixes issue in apache >=2.4
    <IfModule mod_dir.c>
        DirectoryIndex disabled
        DirectorySlash On
    </IfModule>

    SetEnv HTTP_MOD_REWRITE On
    RewriteEngine On
    RewriteBase '/public'

    

    # Deny access to potentially sensitive files and folders
    RewriteRule ^vendor(/|$) - [F,L,NC]
    RewriteRule ^\.env - [F,L,NC]
    RewriteRule silverstripe-cache(/|$) - [F,L,NC]
    RewriteRule composer\.(json|lock) - [F,L,NC]
    RewriteRule (error|silverstripe|debug)\.log - [F,L,NC]

    # Process through SilverStripe if no file with the requested name exists.
    # Pass through the original path as a query parameter, and retain the existing parameters.
    # Try finding framework in the vendor folder first
    RewriteCond %{REQUEST_URI} ^(.*)$
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule .* index.php
</IfModule>
### SILVERSTRIPE END ###


The content of the .htaccess file in the root is:

RewriteEngine On
RewriteRule ^(.*)$ public/$1

i find the problem. the .htaccess of my public folder has

Deny access to potentially sensitive files and folders

RewriteRule ^vendor(/|$) - [F,L,NC]

i remove
RewriteRule ^vendor(/|$) - [F,L,NC]

is what i have done, okay?

Can you post your composer.json file? I wonder if you could have mis-matched cms and framework versions.

i am using 4.3. but i think 4.6.1 htaccess is the one i used. i am not really sure.

here is my composer.json

Blockquote
{
“name”: “silverstripe/installer”,
“type”: “silverstripe-recipe”,
“description”: “The SilverStripe Framework Installer”,
“require”: {
“php”: “>=5.6.0”,
“silverstripe/recipe-plugin”: “^1.2”,
“silverstripe/recipe-cms”: “4.3.3@stable”,
“silverstripe-themes/simple”: “~3.2.0”,
“bummzack/sortablefile”: “^2.0”,
“undefinedoffset/sortablegridfield”: “^2.0”,
“unclecheese/betterbuttons”: “dev-feature/ss4-upgrade”,
“phpmailer/phpmailer”: “^6.0”,
“gargron/fileupload”: “~1.4.0”
},
“require-dev”: {
“phpunit/phpunit”: “^5.7”
},
“extra”: {
“project-files-installed”: [
“app/.htaccess”,
“app/_config.php”,
“app/_config/mysite.yml”,
“app/src/Page.php”,
“app/src/PageController.php”
],
“public-files-installed”: [
“.htaccess”,
“index.php”,
“install-frameworkmissing.html”,
“install.php”,
“web.config”
],
“expose”: [
“themes/main/assets”,
“themes/main/css”,
“themes/main/fonts”,
“themes/main/images”,
“themes/main/js”,
“themes/main/templates”

    ]
},
"config": {
    "process-timeout": 600
},
"prefer-stable": true,
"minimum-stability": "dev"

}

Using a .htaccess file from a different version of SS could cause issues.

Assuming it’s safe to experiment (you have source control set up etc.) I would try making these changes to your composer.json file:

  1. Change “silverstripe/recipe-cms”: “4.3.3@stable” to “silverstripe/recipe-cms”: “^4.6”
  2. Delete the “app/.htaccess”, line from the “extra” section
  3. Delete the whole “public-files-installed” section

Then run composer update and see what happens. It should hopefully upgrade you to the latest stable version of Silverstripe, and reset your htaccess files.