Moving an archived installation to a subdirectory

I’m having some difficulties moving an old version of my development site to a subdirectory. I don’t usually deal with subdirectories like this, so I may have screwed up somewhere. I cannot even load the setup either.

  • I copied the DB to a new table and the files to a subdirectory called QA1.
  • I updated the config files in the root, manager and components directories with the new subfolder
  • I updated the core config file with the new directories for base, assets, etc.
  • I manually cleared the cache directory too just in case.
  • I updated my htaccess file (which may be the problem)

After all that, i’m still getting an ERR_TOO_MANY_REDIRECTS message when loading the site in the new location https://dev.domain.com/QA1.

In my htaccess file, I made the following changes:

For the Base

  • RewriteBase /QA1/

For strict URLs

  • RewriteCond %{HTTP_HOST} !^dev\.domain\.com/QA1/ [NC]
  • RewriteRule ^(.*)$ https://dev.domain.com/QA1/$1 [R=301,L] .

For SSL

  • RewriteRule (.*) https://dev.domain.com/QA1/$1 [R=301,L]

Any help is appreciated
thx

If you don’t have any RewriteCond for this line

RewriteRule (.*) https://dev.domain.com/QA1/$1 [R=301,L]

then you probably have to add one.

RewriteCond %{HTTPS} !=on [OR]
RewriteCond %{SERVER_PORT} !^443
1 Like

This is the full breakdown of what i have there, I just showed what i changed.

# Rewrite www.example.com -> example.com -- used with SEO Strict URLs plugin
#RewriteCond %{HTTP_HOST} .
#RewriteCond %{HTTP_HOST} ^www.(.*)$ [NC]
#RewriteRule ^(.*)$ https://%1/$1 [R=301,L]
#
# or for the opposite example.com -> www.example.com use the following
# DO NOT USE BOTH
#
RewriteCond %{HTTP_HOST} !^$
RewriteCond %{HTTP_HOST} !^dev\.domain\.com/QA1/ [NC]
RewriteCond %{HTTP_HOST} (.+)$
RewriteRule ^(.*)$ https://dev.domain.com/QA1/$1 [R=301,L] .



# Rewrite secure requests properly to prevent SSL cert warnings, e.g. prevent 
# https://www.example.com when your cert only allows https://secure.example.com
RewriteCond %{SERVER_PORT} !^443
RewriteRule (.*) https://dev.domain.com/QA1/$1 [R=301,L]

isn’t it easier to create another subdomain, so you don’t have to deal with the .htaccess file?

maybe, i thought about that too. But this thing is supposed to only be temporary.

I suppose the problem is here. The condition is always met because the folder /QA1/ is never a part of HTTP_HOST. Therefore the request recursively redirects.

Don’t forget the config.core.php file in the connectors directory.