20i Reseller Hosting

Website help

Discussion in 'Website Design' started by Systreg, Apr 16, 2020.

  1. Systreg

    Systreg Well-Known Member

    Joined:
    Oct 2008
    Posts:
    7,471
    Likes Received:
    221
    Hi,

    I downloaded an html theme from w3layouts.com, edited it to my liking and uploaded the new site, but it appeared on the page as if the style sheet code was missing, I then pasted the style sheet code between <style></style> tags and added it to the head section in the html of the index page instead, and some of the styling appeared after doing that, but most of it was still not displaying properly.

    I've downloaded the theme again and uploaded it to a different domain, just in case I made an error when editing the style sheet somewhere, but the new upload of the original unedited theme is still not displaying properly.

    I've put the unedited theme on [link removed as issue resolved for this problem] and hope someone can take a look at it and let me know why it's not displaying? That url only works with www. in front of it, I get a 500 internal error if visiting that without the www. as I haven't set up a .htaccesss file for it.

    Alternatively, if anyone has some time on their hands and wants to download the theme, it's here
     
    Last edited: Apr 16, 2020
  2. Domain Forum

    Acorn Domains Elite Member

    Joined:
    1999
    Messages:
    Many
    Likes Received:
    Lots
    articles.co.uk
     
  3. boxfish United Kingdom

    boxfish Well-Known Member

    Joined:
    Jul 2010
    Posts:
    1,043
    Likes Received:
    80
    • Like Like x 1
  4. cyberpunk United Kingdom

    cyberpunk Active Member

    Joined:
    Jul 2019
    Posts:
    86
    Likes Received:
    11
    Having had a quick look, I don't think it's a problem with the theme. There seems to be an issue with your server serving files (css, js) from the root.

    eg: /css/bootstrap.css gives a 500 error.

    If you fix that, the styling will be fixed.

    Hope that helps,
    Dave
     
    • Like Like x 1
    • Agree Agree x 1
  5. Systreg

    Systreg Well-Known Member

    Joined:
    Oct 2008
    Posts:
    7,471
    Likes Received:
    221
    Thanks, just noticed where you posted the css file urls giving errors, and looking at the source code on the index page it has those 3 like this:

    <link href="css/bootstrap.css" rel='stylesheet' type='text/css' />
    <link href="css/style.css" rel='stylesheet' type='text/css' />
    <link href="css/font-awesome.css

    I though that didn't look right so I removed the css/ part from each and the home page now displays alomost correctly, are those css/ bits supposed to be there or not?
     
  6. Systreg

    Systreg Well-Known Member

    Joined:
    Oct 2008
    Posts:
    7,471
    Likes Received:
    221
    Same with this line in the code:

    <link href="css/animate.css" rel="stylesheet" type="text/css" media="all">

    Removing the css/ before animate.css make the animations work, so guessing that's the problem, if so, not sure why they included the css/ in front of the other code.
     
  7. cyberpunk United Kingdom

    cyberpunk Active Member

    Joined:
    Jul 2019
    Posts:
    86
    Likes Received:
    11
    The "css/bootstrap.css" is just a path relative to wherever the base href is set (normally /)

    so on your server, you should have a "css" directory in your home directory containing a file called bootstrap.css within it. If that does exist, then it sounds like it could be a problem with permissions. You may need to chmod the files or folders to make them read/executable to the server process.
     
    • Like Like x 1
    • Agree Agree x 1
  8. Systreg

    Systreg Well-Known Member

    Joined:
    Oct 2008
    Posts:
    7,471
    Likes Received:
    221
    Ahh, I see, I don't have any named directory like "css" in my home directory like, all site files are lumped in together on one directory page without folders. as you suggest, that'll be why they included the css/ bit in the lines of code then, thanks for all the help.
     
  9. cyberpunk United Kingdom

    cyberpunk Active Member

    Joined:
    Jul 2019
    Posts:
    86
    Likes Received:
    11
    no problem - you'll need to create the "js" directory too and move the associated javascript files into there also
     
    • Like Like x 1
  10. Systreg

    Systreg Well-Known Member

    Joined:
    Oct 2008
    Posts:
    7,471
    Likes Received:
    221
    Ok, next question :)

    Now that the css stuff is figured out, I edited the html files to remove the css/ from the source code and then my new website worked fine.

    Now I have another problem, the site only works if you go to it with www. in front of the url, so I added a .HTACCESS file hoping that would redirect it to the www. version, but after adding the HTACCESS file, the site doesn't resolve with or without the www. so I need to remove it, but can't see that file listed anywhere, then I found this via Google which says files like that which begin with a dot are hidden:

    Any ideas how to remove it, as I can't see anything called hidden files etc?

    [Edit]

    Found settings button now, right in front of my bloody eyes and removed the HTACCESS file, but site still not resolving.
     
    Last edited: Apr 16, 2020
  11. cyberpunk United Kingdom

    cyberpunk Active Member

    Joined:
    Jul 2019
    Posts:
    86
    Likes Received:
    11
    Do you have shell access to your server?

    If you can ssh into the server, then at the prompt

    $ls -a

    Should show the .htaccess file

    You can then issue a

    $rm .htaccess

    to remove it
     
  12. Systreg

    Systreg Well-Known Member

    Joined:
    Oct 2008
    Posts:
    7,471
    Likes Received:
    221
    Sorry mate, was just editing my last post to say this when you replied:

     
  13. cyberpunk United Kingdom

    cyberpunk Active Member

    Joined:
    Jul 2019
    Posts:
    86
    Likes Received:
    11
  14. Systreg

    Systreg Well-Known Member

    Joined:
    Oct 2008
    Posts:
    7,471
    Likes Received:
    221
    This is the content of the HTACCESS file:

    I want anyone going to domain.co.uk to go to www.domain.co.uk
     
  15. Systreg

    Systreg Well-Known Member

    Joined:
    Oct 2008
    Posts:
    7,471
    Likes Received:
    221
  16. cyberpunk United Kingdom

    cyberpunk Active Member

    Joined:
    Jul 2019
    Posts:
    86
    Likes Received:
    11
    Ok I think the regular expression is slightly off, try this

    Code:
    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^yourdomain.com [NC]
    RewriteRule ^(.*)$ http://www.yourdomain.com/$1 [L,R=301]
     
  17. Systreg

    Systreg Well-Known Member

    Joined:
    Oct 2008
    Posts:
    7,471
    Likes Received:
    221
    Thanks, changed the file to that but still not resolving and showing double domain in the url if going to it without the www. Got to pop out for 1/2 hour and will close browser for now to see if cache clears and flush dns
     
  18. cyberpunk United Kingdom

    cyberpunk Active Member

    Joined:
    Jul 2019
    Posts:
    86
    Likes Received:
    11
    if you're using chrome, you could press F12 dev tools, check the "disable cache"
     
  19. Ben Thomas

    Ben Thomas Well-Known Member

    Joined:
    Mar 2018
    Posts:
    1,477
    Likes Received:
    177
    Try getting rid of the variable for host, type the actual domain in there instead.

    Code:
    RewriteEngine On
    RewriteCond %{HTTP_HOST} ^domain.co.uk$ [NC]
    RewriteRule (.*) https://www.domain.co.uk/$1 [R=301,L]

    EDIT: Scrap that, try this it's much better and makes sure that every request gets through whether it's HTTPS or not.

    Code:
    RewriteCond %{HTTP_HOST} ^[^.]+\.[^.]+$
    RewriteCond %{HTTPS}s ^on(s)|
    RewriteRule ^ http%1://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
     
  20. Ben Thomas

    Ben Thomas Well-Known Member

    Joined:
    Mar 2018
    Posts:
    1,477
    Likes Received:
    177
    To be fair, I don't know why you'd want people to be redirected to www. It used to matter back in the day, but it doesn't matter at all now. I think it looks much better without the www
     
  21. Systreg

    Systreg Well-Known Member

    Joined:
    Oct 2008
    Posts:
    7,471
    Likes Received:
    221
    @cyberpunk, I'm on Firefox, but I did just check on Chrome and the site doesn't resolve on there either, clicked F12 but don't see anything for disabling cache under dev tools/settings

    @Ben Thomas, already tried that mate, @cyberpunk posted the same above.