redirect domain to subfolder while build new root
-
Is it possible to redirect my domain name – pjnphoto.com to a subfolder (/pjnphoto) to keep my old site live while I redesign my new site based on wordpress in the root using the ip address http://66.147.244.61/~pjnphoto/
?
The problem: The htaccess redirect to subfolder worked but after I installed wordpress – code was added to the end of the htaccess file – see begin and end of wordpress code below. I don’t understand this code but it’s causing the live site (redirected to the subfolder) to throw a 500 error but the ip address is still pointing to the root/new wp redesign which is currently under development. If I remove the code both ip and domain name resolve correctly but I’m not sure what I am breaking by removing the code.My main interest: I need to redirect my domain name pjnphoto.com to a subfolder while I redesign a new site i nthe root using wordpress – any suggestions? Maybe I’m going about this wrong. Thx
# Use PHP5.4 as default
AddHandler application/x-httpd-php54 .php
# BlueHost.com – all lines above are the original code lines before this below edit to redirect to subdirectory
# .htaccess main domain to subdirectory redirect
# Do not change this line.
RewriteEngine on
# Change example.com to be your main domain.
RewriteCond %{HTTP_HOST} ^(www.)?pjnphoto.com$
# Change ‘subdirectory’ to be the directory you will use for your main domain.
RewriteCond %{REQUEST_URI} !^/pjnphoto/
# Don’t change the following two lines.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# Change ‘subdirectory’ to be the directory you will use for your main domain.
RewriteRule ^(.*)$ /pjnphoto/$1
# Change example.com to be your main domain again.
# Change ‘subdirectory’ to be the directory you will use for your main domain
# followed by / then the main file for your site, index.php, index.html, etc.
RewriteCond %{HTTP_HOST} ^(www.)?pjnphoto.com$
RewriteRule ^(/)?$ pjnphoto/index.html [L]
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /~pjnphoto/
RewriteRule ^index\.php$ – [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /~pjnphoto/index.php [L]
</IfModule># END WordPress
- The topic ‘redirect domain to subfolder while build new root’ is closed to new replies.