Forked from quinncomendant/.htaccess for WP subdirectory installation
Created
September 12, 2022 03:22
-
-
Save davidduong90/813ea065098a822b9b727925ebbc043e to your computer and use it in GitHub Desktop.
This .htaccess file works with Wordpress installed under a subdirectory wp/ inside the document root.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# BEGIN WordPress | |
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
# Make the admin still accessible from /wp-admin | |
RewriteCond %{REQUEST_URI} ^/wp-admin/?(.*) | |
RewriteRule .* wp/wp-admin/$1 [L,R=301] | |
RewriteCond %{REQUEST_URI} ^/wp/?$ | |
RewriteRule .* wp/wp-admin/ [L,R=301] | |
# Base is the URL path of the home directory | |
RewriteBase / | |
RewriteRule ^$ wp/index.php [L] | |
# Skip real files and directories | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteCond %{REQUEST_FILENAME} !-d | |
# Otherwise send it to WordPress | |
RewriteRule .* wp/index.php [L] | |
</IfModule> | |
# END WordPress |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment