roots / sage

WordPress starter theme with Laravel Blade components and templates, Tailwind CSS, and a modern development workflow
https://roots.io/sage/
MIT License
12.74k stars 3.06k forks source link

Roots can not find CSS and JS files #426

Closed plekter closed 12 years ago

plekter commented 12 years ago

Hello! I really like Roots and would love to tinker around but Ive gotten a small problem at hands. I have a fresh WP 3.3.2 installation and latest Roots cloned from here but after installation, it does not find the CSS and JS files declared in head.

I am not sure what the issue could be but Im sure Im not the only one. Anyone has any helpful information?

onthehoods commented 12 years ago

I'm working on a different site now and I'm getting the same issues as everyone else here. Tried everything and can't get the css and js files to be recognised. If I manually put the code in the .htaccess files it always changes the permissions to 644 instead of the 755 I've set.

aarongitlin commented 12 years ago

I realize this is closed, but I had similar problems, but following @hixen's steps got it working in 2 seconds. Thanks man!

rsimko commented 12 years ago

this thing drives me crazy...I tried everything described here and nothing works. Its fresh WP instal. Once I managed to get it work with custom permalink structure but once I imported my blog in everything broke again. Now I cannot make it work again unless I change permalinks back to default :(

just to add to it, install on wordpress multisite went ok. I am not sure what to make of it. I don't really need multisite install

squibsy commented 12 years ago

I've just come across a variant of this that doesn't seem to have appeared in the thread so far. I've installed WordPress on XAMPP with the WP folder two directories deeper than the webroot. i.e. WP is at http://localhost/dir/subdir

I'm seeing the path to the CSS files in the HTML source as /dir/subdir/dir/subdir/assets/css/bootstrap.css , etc.

In other words, it's doubling up on the first part of the path.

My .htaccess is here: http://pastebin.com/sUMmtu3b

squibsy commented 12 years ago

Sorry - this is a duplicate of https://github.com/retlehs/roots/issues/395

faridjame commented 11 years ago

I have also installed this theme on localhost (on a XAMPP set up) and inside a subfolder in my htdocs and the theme failed to find all the assets files.

jmaheux commented 11 years ago

For me, when I activated the roots theme, my .htaccess was not writeable. I then gave it sufficient right and I had to activate a default theme and then re-activate the roots theme.

@faridjame a .htaccess in the root of your htdocs could easily be causing this.

faridjame commented 11 years ago

My .htaccess is writable and I can verify that roots does actually generate it; however, it puts wrong paths in there causing the issue. I don't have the .htaccess in front of me, but in my situation it was something like "rewrite /projects/my-project" where it shoud've been just "rewrite /" (writing the syntax from memory)

Teqon commented 11 years ago

I was experiencing the same problems. In my case the only thing i did was change the theme folder name to 'roots' because after download it had another name

jimstarace commented 11 years ago

I had the same issue and struggled for 8 hours with it. I was convinced it was the Roots theme, until i deleted it and tried permalinks on the default theme. With the default theme pretty permalinks did not work either.

For me the solution was in my virtual host file where directory directives are set. I had AllowOverride None, where it should have been AllowOverride All.

I came to this conclusion by reading http://codex.wordpress.org/Using_Permalinks, where it specifically states all the requirements necessary for Using "Pretty" permalinks.

I highly suggest anyone having this same issue read the above article in detail to be sure your server settings are correct.

Hope this saves someone else some time.

Cheers!

dlchung commented 11 years ago

So I'm having similar issues here. I was developing on dev server, but when transferring the site to another server, I decided to move the install into a subdirectory. Now the CSS, JS, and images don't show.

I know it's an issue with the .htaccess file, because when I change the rewrite rules to include the subdirectory, everything works again. However, when I go to save my permalink settings again, my changes are overwritten, and we're back to missing assets.

I assumed the roots theme supported wordpress installed in subdirectories. Is there something I'm doing wrong?

EDIT: Ok, it appears my issue is related to this: https://github.com/retlehs/roots/issues/533

robertcrenteria commented 11 years ago

I had the same issue but was able to correct it by refreshing the permalinks. What I mean by that is simply jumping to Settings/Permalinks and clicking 'Save Changes'. Any time I am experiencing strange path issues where none existed before this is always my first step. Hope this helps!

ghost commented 11 years ago

I fixed this issue by following @retlehs advice (thanks!): disable root relative URLs in roots/lib/config.php (I commented out the first add_theme_support() call).

I'm running my wordpress install in a subfolder on my server (http://server.com/wp/blogname) for testing purposes, and according to Firebug, my problem was caused by hard-coded URLs in the generated HTML looking for my JS and CSS files at /wp/blogname/wp/blogname/assets/filename.js - note the duplicated blog root path. This was only fixed by commenting the function call above, after having tried: deactivating/reactivating the theme, confirming .htaccess was correct, refreshing permalink settings, clearing browser cache, setting all the activation options to both Yes and No after fresh activations, etc.

gfxpixeldesigns commented 11 years ago

Same problem here. Also following @retlehs i was able to fix the issue by disabling: add_theme_support('rewrites'); // Enable URL rewrites I'm not sure if there are any downsides to using this method but so far everything is working.

ghost commented 11 years ago

@yhristov - your comment on WAMP's mod_rewrite not being enabled worked for me, thanks man!

dangelion commented 11 years ago

@yhristov : yeah! It worked also for me. Thanks! On Wamp the rewrite_module is disabled by default. Enable it!

AICanary commented 11 years ago

@yhristov You are ROCK and i see your message end of page , i have just enable the ewrite_module and its working great for me, thanks

findhvacdealer commented 11 years ago

What is the downside of disabling add_theme_support('rewrites'); in config.php? I had to do this on a WAMP installation today to get it to find stuff using the latest Roots (8/21/2013) and Wordpress 3.6.

findhvacdealer commented 11 years ago

Hey everyone - my problem wasn't Roots related. It was because my install of Apache didn't have the rewrites module enabled. I was using a WAMP install.

http://wordpress.org/support/topic/using-wamp-new-pages-get-404-requested-url-not-found-on-this-server?replies=18

elparkino commented 11 years ago

I am completely mystified by my issue. Locally I'm having the same problem stated above, the re-writes don't seem to be taking effect, but live everything is working fine. I have mod_rewrite enabled and I've flushed my permalinks, done all the suggested edits to my .htaccess file and still nothing!

So I could stop worrying about it and since everything is working fine live what i decided was to symlink my assets directory into the root wordpress install directory and everything is peachy.

any updates?

JulienMelissas commented 11 years ago

Are you using WAMP/LAMP or a nginx server locally? What about in your live setting?

On Sunday, September 22, 2013, Parker Jones wrote:

I am completely mystified by my issue. Locally I'm having the same problem stated above, the re-writes don't seem to be taking effect, but live everything is working fine. I have mod_rewrite enabled and I've flushed my permalinks, done all the suggested edits to my .htaccess file and still nothing!

So I could stop worrying about it and since everything is working fine live what i decided was to symlink my assets directory into the root wordpress install directory and everything is peachy.

any updates?

— Reply to this email directly or view it on GitHubhttps://github.com/roots/roots/issues/426#issuecomment-24886870 .

elparkino commented 11 years ago

I'm running os x snow leapord-AMP locally, LAMP remotely

JulienMelissas commented 11 years ago

@elparkino, I'm thinking it could be something related to the way your local MAMP is setup in that it might not play well with mod rewrite, even if that's enabled, so I'd look into that first. Wish I could help more but I don't know too much about the MAMP setups as I run most stuff locally in a VM. Good luck!

wilbo commented 9 years ago

I struggled with this for half a day...

I work with Mamp and I was always working from sub directories, until i learned creating a virtual host per site.

matthisamoto commented 9 years ago

I had a similar issue, and after doing everything in this thread, it still wasn't working. Then I noticed my .htaccess was a little... verbose. So the Permalinks flush does NOT completely overwrite your .htaccess, it appends the Wordpress section and rewrites only that section. If you had copied in an .htaccess file from another project due to a boilerplate situation, or had written in anything that might interfere, Permalinks flushing will not cure the problem. Clear the other stuff out and it should work. Did for me.

snoopdouglas commented 8 years ago

Might be worth mentioning that I came across this exact same problem, only the reason that the assets weren't appearing is that I hadn't yet gulp'd. Doh.