Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

not working in subfolder #13

Closed
syahzul opened this issue Apr 3, 2011 · 17 comments
Closed

not working in subfolder #13

syahzul opened this issue Apr 3, 2011 · 17 comments

Comments

@syahzul
Copy link

syahzul commented Apr 3, 2011

i try to install it in subfolder, for example http://example.net/wordpress/, all styling gone. all images also not found, but if i install it in root domain, http://example.net/, everything working just fine. i suspect it got to do with .htaccess, but still cannot find any solution.

@retlehs
Copy link
Member

retlehs commented Apr 3, 2011

nice catch, i hadn't tested roots in a subfolder since we added rewrites from /wp-content/themes/roots/css/ (and js/ and img/) to /css/ etc.

looking into it now -- looks like it's in roots-cleanup.php starting at line 28 that must be fixed

@swartsr
Copy link

swartsr commented Apr 4, 2011

Thanks for looking into this! I'm having the same issue... I set up a child theme folder for my website so when you update I can pull down your latest stuff without breaking anything. It seems to be causing broken links for me too. Thank you!

@retlehs
Copy link
Member

retlehs commented Apr 4, 2011

@swalkinshaw is working on a fix but not sure when he'll get it out (just left for a trip today)

in the meantime you could removes lines 1 through 45 on roots-cleanup.php to get it so you can at least work in a subfolder for now -- basically remove the roots_add_rewrites and roots_clean_assets/plugins functions

@swartsr
Copy link

swartsr commented Apr 4, 2011

Thanks! Appreciate it!

@misfist
Copy link

misfist commented Apr 4, 2011

I also have WP installed in a sub-directory (called /wordpress) and am having the same problem. I commented out lines 8-45 (line 1 is <?php and 2-7 are already commented out), but it's looking for css, js and img directories in:

/wp-content/themes/roots/
It needs to be:
/wordpress/wp-content/themes/roots/

Any ideas?

Thanks!

@retlehs
Copy link
Member

retlehs commented Apr 4, 2011

hmm the rewrite rules might need to be flushed after that -- try going to the permalinks page and clicking 'save' just to make that happen

if you still have the problem then you can take out the root relative filters in roots-cleanup.php

sorry about the troubles in subfolders! will get this fixed asap.

@retlehs
Copy link
Member

retlehs commented Apr 4, 2011

i think scott got this working.. will try and push it out to the repo tonight

@swalkinshaw
Copy link
Member

Updated relative path function to work with sub dirs - closed by 40485c7

@retlehs retlehs closed this as completed Apr 5, 2011
@misfist
Copy link

misfist commented Apr 5, 2011

I replaced the roots-cleanup.php file and it appears to be working correctly.

Thanks!

@swalkinshaw
Copy link
Member

Yep, that's the only file that's been changed. Let me know how it goes. I tested it on a subfolder install but you never know...

@misfist
Copy link

misfist commented Apr 5, 2011

I replaced the roots-cleanup.php file and it appears to be working correctly.

Thanks very much!

@bonny
Copy link

bonny commented May 11, 2011

I just installed roots in a subfolder and it does not work. It will however work if I replace roots-cleanup.php with the version from april 04. So... something must have happened between now and april 04. Should I start a new issue about this?

@retlehs
Copy link
Member

retlehs commented May 11, 2011

i have the latest roots and latest WP installed in a subdirectory

are you sure that maybe your .htaccess file just wasn't generated yet? need some more info besides 'does not work', what's broken.. file paths?

@bonny
Copy link

bonny commented May 11, 2011

Ok, does this help:

WordPress is installed in /wordpress/

The link-tag for the stylesheet looks like this:
link rel="stylesheet" href="/wordpress/css/style.css"

/wordpress/css/style.css gives a file not found/404

If I manually go to
/css/style.css
it will show me the css-file, which makes me think that the htaccess does indeed work.

If i remove
add_filter('template_directory_uri', 'roots_clean_assets');
from roots-cleanup.php it will work (but output old ugly code, of course)

Oh, and I just realized I am using WP 3.2-bleeding and not the latest stable, so maybe that has something to do with it.

@retlehs
Copy link
Member

retlehs commented May 11, 2011

i just installed wordpress 3.2 nightly and the latest roots into a subdirectory, all paths/redirects working properly

if you're getting 404 when trying to hit /wordpress/css/style.css then it sounds like your .htaccess isn't getting generated or isn't working like it should

@bonny
Copy link

bonny commented May 12, 2011

The .htaccess do get generated. But I'll try it on another server and see if that helps. Hopefully there's something weird going on on this one. Thanks for your time!

@retlehs
Copy link
Member

retlehs commented May 12, 2011

you mention that you're able to hit /css/style.css but not /wordpress/css/style.css, is it possible that your .htaccess file is in the root and not at /wordpress/.htaccess? also, can you provide us with the .htaccess file that's on your server?

leoj3n pushed a commit to leoj3n/roots that referenced this issue Nov 5, 2012
paulopmt1 pushed a commit to paulopmt1/sage that referenced this issue Feb 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants