…just point Apache’s root directory to
/public_html/development
If you do this, I would seriously consider renaming “development” to “live” or something more meaningful, otherwise it’s going to get confusing going forward.
Then you can create an .htaccess
file in the document root with just the following mod_rewrite directive to rewrite everything to the /live
subdirectory (rename the old .htaccess
file .htaccess-old
or something).
RewriteEngine On
RewriteRule (.*) /live/$1 [L]
This avoids a rewrite loop because of the .htaccess
file in the /live
subdirectory that contains the WordPress front-controller (of the development/live site).
You will need to make sure the URL structure does not contain the /development
path segment.
This is as close to changing the document root you can get, without actually changing the document root.
Related Posts:
- Which one does WordPress prioritize when it comes to php.ini, wp-config and .htaccess?
- Improve wordpress security by hiding non public resources
- Rewrite /?rest_route=/ link to /wp-json/ without changing default permalink structure in apache
- index.php not loading in main folder of wordpress
- Admin-Ajax.php, SSL, Non-SSL
- Redirect from different port to subdomain – htaccess
- WordPress 404 on Subdomain
- Only expose routes with prefix /wp-json on WordPress using Apache
- .htaccess file missing from WordPress install directory
- What’s the opposite of required valid user in .htaccess authentication
- How can i redirect one url to another url using .htaccess or add_rewrite_rule
- Override htacces rule only for specific directory
- Restrict uploaded files into a custom folder to logged in users by htaccess: looking for Nginx – not only Apache – solution
- WP install in sub-dir white screen
- How do I test to ensure that my wp-config file is protected?
- .htaccess Security Header Rules
- mod_rewrite loop, redirecting http to https on certain section of wordpress blog
- .htaccess in subdir gets ignored by WordPress’ own .htaccess in /
- Directing subdomain to main domain and keeping the subdomain format with .htaccess
- How to block access to files without modifying .htaccess or ngnix config? [closed]
- Redirect old domain with query paramaters
- Weird behavior of Dashboard, must be core files
- Does WP suppresses .htaccess if permalinks are disabled?
- fix 302 redirection error on https
- Access sub-domain when root public_html is protected with .htaccess password
- Accepting special characters in querystring
- WordPress permalinks confusion
- WordPress constantly running out of memory
- Getting WordPress to work inside a rails 3 application
- Configure .htaccess to have a WordPress single site installation with all subdomains pointing to the same pages?
- Clone WordPress for testing on localhost (with Fiddler)
- Should I prevent access to .htaccess and wp-config.php files?
- Unable leverage Browser Caching on AWS Bitnami stack (Apache) through W3TC and Cloudfront CDN
- How to move wordpress website from hosting account to localhost
- Steps for WordPress over SSL
- How to block wordpress admin by htaccess
- I can access subdirectory, but not files within it
- .htaccess and virtual host configuration for WP in its own directory
- WordPress redirection
- How To Add CSP frame ancestors in WordPress Website? [closed]
- Subfolder install not working
- Browser Caching .htaccess
- Hardening WordPress – how to set .htaccess permissions?
- Avoid duplicate content on pretty URLs with htaccess
- ssl_error_rx_record_too_long and Apache SSL [closed]
- How can I use an .htaccess file in Nginx?
- .htaccess redirect http to https
- Redirect vs RedirectMatch
- How to automatically redirect HTTP to HTTPS on Apache servers?
- htaccess – Redirect to subfolder without changing browser URL
- How do I disable directory browsing?
- Https to http redirect using htaccess
- Getting a 500 Internal Server Error on Laravel 5+ Ubuntu 14.04
- How to remove index.php from WordPress site URL
- .htaccess: Invalid command ‘RewriteEngine’, perhaps misspelled or defined by a module not included in the server configuration
- Redirect old php link to wordpress link in .htaccess
- Redirect old php link to wordpress link in .htaccess
- Cant login to wp-admin (redirecting to homepage), But CAN login to wp-login.php
- Cant login to wp-admin (redirecting to homepage), But CAN login to wp-login.php
- Best collection of code for your .htaccess file [closed]
- Site Redirecting to wp-signup.php
- Moving a WP Multisite to a subdirectory
- Default .htaccess file for WordPress?
- Control verbosity level of WP DEBUG?
- Multisite Network Port Num Issues?
- WordPress site hacked. Has .htaccess been hacked?
- Does this .htaccess security setting really work?
- Use subdomain for certain urls
- htaccess problem after saving Settings
- multisite 404 error for subdirectory
- Multisite htaccess on localhost with WP as an SVN external?
- Stop WordPress and Plugins from Overwriting .htaccess
- Move WordPress to subdirectory, keep ALL URLs
- File and directory permissions
- htaccess disable WordPress rewrite rules for folder and its contents
- WP-Admin not working properly at WordPress multisite with subdirectories
- htaccess rewrite conflict with wordpress rules and ssl
- How to use live images on local install?
- htaccess https redirect from www to non-www
- Permalink Issues by Installing WordPress in Subdirectory / Subfolder
- Generate WordPress salt
- Htaccess for Wordpess set on single subdomain
- WordPress PHP error handling and reporting in production environment
- adding rewrite rules in .htaccess
- How to combine javascript files without plugins?
- .htaccess and 500 error, extra character added
- Name-based virtual host configuration in Apache seems to cause a “500 Internal Server Error”
- Place static HTML files in path below WordPress page
- Declaratively Configuring WordPress in XML or JSON or YAML
- WordPress Multisite – Multiple subfolders for blogs
- WordPress multisite subdirectory redirect infinite loop issue
- Static raw HTML page
- WordPress + Magento .htaccess ReWriteRule Issue (www vs. non-www)
- Override Current Theme Setting in wp_config.php
- Plugin to edit htaccess file
- htaccess rewrite for author query string when WP is in subfolder
- Why “Settings->Permalinks” creates .htaccess file on nginx server?
- .htaccess for wordpress inside another wordpress install
- .htaccess file redirecting to parent directory
- WordPress in sub directory wp-admin problem