Skip to content

Instantly share code, notes, and snippets.

@fromthestone
Created August 7, 2014 07:14
Show Gist options
  • Save fromthestone/32a8a8acb8e06dd33d01 to your computer and use it in GitHub Desktop.
Save fromthestone/32a8a8acb8e06dd33d01 to your computer and use it in GitHub Desktop.
Redirect a WP installation that is hosted in a subdirectory without losing the chance to keep your WP files into another subfolder
#Use this .htaccess if your WP is hosted in a subdirectory and not in the ROOT of the webserver.
#install this file in yourwp directory and not in the ROOT
#Change your_dir with the right name
#We assume that you installed WP into a subdirectory called yourwpinstallation and you want show the website www.wpwebsi.te/yourwp/
#for Example www.wpwebsi.te/yourwp/yourwpinstallation => RewriteRule . yourwp/index.php [L]
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . your_dir/index.php [L]
</IfModule>
# END WordPress
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment