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

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 ^(.*)$$1 [R=301,L] .


  • RewriteRule (.*)$1 [R=301,L]

Any help is appreciated

If you don’t have any RewriteCond for this line

RewriteRule (.*)$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 -> -- 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 -> use the following
RewriteCond %{HTTP_HOST} !^$
RewriteCond %{HTTP_HOST} !^dev\.domain\.com/QA1/ [NC]
RewriteCond %{HTTP_HOST} (.+)$
RewriteRule ^(.*)$$1 [R=301,L] .

# Rewrite secure requests properly to prevent SSL cert warnings, e.g. prevent 
# when your cert only allows
RewriteCond %{SERVER_PORT} !^443
RewriteRule (.*)$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.