$conf, $runtime; function_exists('chdir') AND chdir(APP_PATH); $r = 'mysql' == $conf['cache']['type'] ? website_set('runtime', $runtime) : cache_set('runtime', $runtime); } function runtime_truncate() { global $conf; 'mysql' == $conf['cache']['type'] ? website_set('runtime', '') : cache_delete('runtime'); } register_shutdown_function('runtime_save'); ?>htaccess - Wordpress sites in subfolders|Programmer puzzle solving
最新消息:Welcome to the puzzle paradise for programmers! Here, a well-designed puzzle awaits you. From code logic puzzles to algorithmic challenges, each level is closely centered on the programmer's expertise and skills. Whether you're a novice programmer or an experienced tech guru, you'll find your own challenges on this site. In the process of solving puzzles, you can not only exercise your thinking skills, but also deepen your understanding and application of programming knowledge. Come to start this puzzle journey full of wisdom and challenges, with many programmers to compete with each other and show your programming wisdom! Translated with DeepL.com (free version)

htaccess - Wordpress sites in subfolders

matteradmin11PV0评论

I have a slightly different question to the usual 'how to put WP into a subfolder'

I have two completely separate variants of the same WP site online - a live and a test one. The sites are in separate folders /livesite and /testsite on my hosted webserver.

If people browse the base domain I want them to access the live WP site in the /livesite folder but without the /livesite/ appearing in the browser URL.

If people browse the test domain (ie domain/testsite) then I want them to access the test site WP in the /testsite folder and I do want the /testsite/ to appear in the URLs (as confirmation that some nastly link hasn't accidentally redirected them from the test to the live site)

Is this possible? I have the live site set up with the (below) .htaccess but am unsure how to redirect /testsite requests appropriately - of even if I need to do this - will the current .htaccess ignore requests to professionalhypnotherapynetwork/testsite ?

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTP_HOST} ^(www.)?professionalhypnotherapynetwork$
RewriteCond %{REQUEST_URI} !^/livesite/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /livesite/$1
RewriteCond %{HTTP_HOST} ^(www.)?professionalhypnotherapynetwork$
RewriteRule ^(/)?$ livesite/index.php [L] 
</IfModule>

Articles related to this article

Post a comment

comment list (0)

  1. No comments so far