1.
Source site: Drupal was in root directory(xxx.com)
Target site: Drupal was installed at sub-directory(yyy.com/xxx)

I took backup of my source site using backup and migrate module and restored to my target site.

Both sites are pointing to separate databases with the same data.

2. When I visit my target site, images are not displaying because site is pointing to root directory.

From my google search, it is recommending to update .htaccess and settings.php file.

https://www.drupal.org/node/144643

In .htaccess:

Was:

<IfModule mod_rewrite.c>

Changed to <IfModule XXXmod_rewrite.c>

In settings.php:

I added this:

# $base_url = 'http://godrupal.info/rincon';  // NO trailing slash!

Above did not work.

Here is the part of the .htaccess file:

  # To redirect all users to access the site WITH the 'www.' prefix,
  # (http://example.com/... will be redirected to http://www.example.com/...)
  # uncomment the following:
  # RewriteCond %{HTTP_HOST} .
  # RewriteCond %{HTTP_HOST} !^www\. [NC]
  # RewriteRule ^ http%{ENV:protossl}://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
  #
  # To redirect all users to access the site WITHOUT the 'www.' prefix,
  # (http://www.example.com/... will be redirected to http://example.com/...)
  # uncomment the following:
  # RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
  # RewriteRule ^ http%{ENV:protossl}://%1%{REQUEST_URI} [L,R=301]

  # Modify the RewriteBase if you are using Drupal in a subdirectory or in a
  # VirtualDocumentRoot and the rewrite rules are not working properly.
  # For example if your site is at http://example.com/drupal uncomment and
  # modify the following line:
   RewriteBase /rincon/
  #
  # If your site is running in a VirtualDocumentRoot at http://example.com/,
  # uncomment the following line:
  # RewriteBase /

I spent 3 hours to fix it and I am lost. Please advise how I can point my target site to subdirectory?

Thanks a lot.

Comments

Jaypan’s picture

You need to remove the # from the start of this line:

# $base_url = 'http://godrupal.info/rincon';  // NO trailing slash!

The # mark comments it out, meaning PHP does not read it.

drupol’s picture

You did it. Thank you so much. It is fixed now.