Forum Moderators: phranque
RewriteEngine On
DirectoryIndex index.php
RewriteBase /new
RewriteRule ^index\.php$ - [L]
# add a trailing slash to /wp-admin
RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L]
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L]
RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L]
RewriteRule . index.php [L]
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /new/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /new/index.php [L]
</IfModule>
# END WordPress [edited by: engine at 7:04 pm (utc) on Oct 8, 2015]
[edit reason] Please use example.com [/edit]
As of now, new Wordpress website works fine if one opens www.example.com or www.example.com/new. However, the old website is still accessible via www.example.com/old, so I would like to redirect it to the new website.
(Site Address is set to www.example.com)tells you why it won't go past the default (index.php)
# BEGIN WordPressand
<IfModule mod_rewrite.c>
# END WordPressbecause WP will create (and/or overwrite) its own snippet in your htaccess file.