.htaccess - Wordpress Multisite development on PHP Built-In Webserver -
i trying set development environment wordpress multisite on local mac. developing using phpstorm, , built-in php webserver. 1 of limitations of built-in webserver is doesn't support apache mod_rewrite, instead uses routing scripts. there's little clear documentation on translating these .htaccess rules.
rewriteengine on rewritebase / rewriterule ^index\.php$ - [l] # add trailing slash /wp-admin rewriterule ^wp-admin$ wp-admin/ [r=301,l] rewritecond %{request_filename} -f [or] rewritecond %{request_filename} -d rewriterule ^ - [l] rewriterule ^(wp-(content|admin|includes).*) wordpress/$1 [l] rewriterule ^(.*\.php)$ wordpress/$1 [l] rewriterule . index.php [l]
is i'm starting from, basic wordpress redirect htaccess multisite wordpress in own directory (/wordpress)... can point me in direction resources on how translate routing script?
so managed work (at least using different domains each site). here took: add line near beginning of wp-config.php detect hostname , define constant it:
define('app_host', $_server['http_host']);
then make following wp-config changes:
/** url wp-content directory */ define('wp_content_url', 'http://' . app_host . '/wp-content'); /** domain name of default wordpress website */ define('domain_current_site', app_host);
(note our wp-content folder seperate our wordpress folder, our setup preference can update wp git , not [that know of] required.)
from there should "update" depending on whatever hostname server running under. limitations we've found built-in web server won't run ssh (thus no ssh admin), , doesn't /wordpress/wp-admin redirect. wp-admin need use local.sitename.com/wordpress/wp-admin/ there. trailing slash important well, won't automatically add it.
Comments
Post a Comment