wesleytodd / YeoPress

A Yeoman generator for WordPress
Other
1.08k stars 163 forks source link

Update wp-config.php.tmpl for hosting in subdir #137

Open agarce opened 9 years ago

agarce commented 9 years ago

This change make the site work if it is hosted in a subdirectory, not in the server's root.

wesleytodd commented 9 years ago

What happens when it is hosted at the root? This seems like it might break that. I can test it, but it would be awesome if you confirmed that it works for that as well before I take a look.

Toddses commented 9 years ago

This won't work even if the site is installed in a subdirectory. You end up with WP looking for files in places like http://localhost/tester/wordpress/wp-admin/wordpress/wp-includes/css/ when you visit an admin page. This is because when you run an admin script, dirname($_SERVER['SCRIPT_NAME']) returns /tester/wordpress/wp-admin, and not just /tester

So this PR needs a little tweaking, but its definitely something I'd like to see pulled in.

agarce commented 9 years ago

Yes, it caused ajax request not working properly for the same reason. Sorry for the waste of time, It was my first pull request in github, I'll be more serious before bother again :)

PD: finally I set the constants in local-config.php... the fast way.

2015-02-02 17:39 GMT+01:00 Todd Miller notifications@github.com:

This won't work even if the site is installed in a subdirectory. You end up with WP looking for files in places like http://localhost/tester/wordpress/wp-admin/wordpress/wp-includes/css/ when you visit an admin page. This is because when you run an admin script, dirname($_SERVER['SCRIPT_NAME']) returns /tester/wordpress/wp-admin, and not just /tester

So this PR needs a little tweaking, but its definitely something I'd like to see pulled in.

— Reply to this email directly or view it on GitHub https://github.com/wesleytodd/YeoPress/pull/137#issuecomment-72489137.

Toddses commented 9 years ago

Hey don't worry about it. If you want to take another shot at it, we'll definitely pull it in!