…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
- Default .htaccess file for WordPress?
- Does this .htaccess security setting really work?
- htaccess disable WordPress rewrite rules for folder and its contents
- WordPress PHP error handling and reporting in production environment
- How to combine javascript files without plugins?
- How disable SSL redirect for specific URL?
- WordPress site displaying 404 for any page apart from index
- Why does the header set X-Robots-Tag apply to all pages?
- Error:406 not acceptable
- .htaccess Rewrite URL WordPress
- A plugin changes my .htaccess file and I can’t access httpd.conf as that’s a shared server
- How to change how long items are kept in the trash?
- How can I code my plugin to safely modify .htaccess?
- HTAccess stops me from accessing WordPress Dashboard links
- Can I configure WordPress to use postfix without a plugin?
- .htaccess rewrite rule puzzle
- Allow logged in users who doesn’t belong to whitelisted ips
- Best way to redirect site in subdirectory to root?
- Missing slash after moving site to subfolder
- WildCard SSL with wordpress subdomain
- AWS WordPress Install – pages/posts 404 on restart until updating permalinks
- browser caching not disabled after disabling in .htaccess
- Transfer to HTTPS – mixed content on main page only [closed]
- Htaccess redirect after changing Language URL format
- Adding a SSL Certificate
- Error uploading files bigger than 58 MB
- Rules in .htaccess only if the requested URL is /wp-admin
- What to write in the htaccess in order to detect browser language and point accordingly?
- how to combine wordpress htaccess on my root domain + php on subfolder
- Allow REST API over HTTP, the rest of the site forced to HTTPS
- How do I apply friendly URL permalinks to a custom WordPress template?
- Conflict with Force SSL and Rewrite Rules
- htaccess problem not being able to overwrite previous rules
- How to rewrite 404 to home page using htaccess?
- how to prefer static page if it exists over wordpress page
- “Oops.” error on an html file directly uploaded to a subdirectory of my WordPress site
- How do I reset a rewrite?
- VServer/Rootserver/Shared Hosting: Multiple WordPress installations each having their unique domain?
- Problem with new Multisite Installation
- Sub domain URL slash / missing after domain and before Post & page slug
- Problem with WordPress permalinks
- Redirect files in uploads directory if WordPress user not logged in
- Getting file errors in a WordPress Multisite ADMIN
- All files in public_html, Cannot launch WordPress site via wp-admin
- I need to make one folder private
- Force HTTPS for mapped domain pointing to wordpress domain
- How can I restrict access, by IP, to the `wp-admin` folder/Dashboard?
- After changing permalink, getting 404 for one particular category
- htaccess mod_rewrite not working
- Giving WordPress it’s own directory and using .htaccess Directory Index
- How can I set up a completely separate (not multisite) WordPress installation as a subdirectory of an existing WordPress blog?
- Restrict download files from not generated Urls
- How to change wordpress news root url
- Problem with All in one WP Migration – only works the home page
- WordPress sections in htaccess kills FrontPage permissions
- How can I stop WordPress from catching URL’s for static pages that I save on my server
- Enable webp support Nginx+Apache reverse proxy with moss.sh [closed]
- WP-Include rewrite directory