I have problem with drupal site when migrate it from dev to production. My website works fine until I tried to login as admin. After enter username,password ,and click login I got error page not found. Because I were redirected to a wrong path. For example. I were redirected to www.domain.com/cgp/user but the correct path should be www.domain.com/user. Bellow is actual screenshot. Does anyone have the same problem and know to to fix it? Thank you. This is actual screenshot

Bellow is virtual host config <VirtualHost *:80> ServerName www.domain.com ServerAlias domain.com DocumentRoot "/root_directory" ProxyPass / http://webserver_id/cgp/ ProxyPassReverse / http://webserver_id/cgp/ ErrorLog "logs/cgp-error_log" CustomLog "logs/cgp-access_log" common # redirect non www to www RewriteEngine On RewriteCond %{HTTP_HOST} !^www\. [NC] RewriteRule ^ http://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L] </VirtualHost>

2 Answers 2


The problem could be in several areas, depending on your deployment method.

First of all, have you cleared your caches? This fixes most issues, especially after importing a database.

It could be a server configuration issue, did you set it up or did someone else? There could be version differences between the installed software on the dev and prod servers.

Lastly, have you tried setting the $base_url in your settings.php?

  • Thank you for your respond. I did set $base_url to my domain. Since I couldn't connect as admin to clean all the cached I connected to database and truncate all cache table but I doesn't work. Do you have any suggestion?
    – noob
    Oct 2, 2014 at 19:06
  • At this point, we're down to troubleshooting. At this point, my first thought is that there is something performing the redirect. Is there custom code performing a drupal_goto(), or is there a module performing a redirect (like logintoboggan or panels)? What does your dev/prod stack look like (same machine, different, etc.)?
    – coreyp_1
    Oct 2, 2014 at 19:10
  • I developed the website on my local using XAMPP. After I finished, I copied all the code to webserver (apache2) root_directory/cgp and dump the database from my local to the sever as well. Then config database connection and base_url.
    – noob
    Oct 2, 2014 at 19:14
  • Follow is set up of virtual host in the server. due to security issue I changed the name the ip. Can you have a look? I think this problem was because of the virtual host setup.
    – noob
    Oct 2, 2014 at 19:20
  • I added virtual host config. Please check my question again. thanks
    – noob
    Oct 2, 2014 at 19:27

I still don't know what cause the problem. I use another trick I saw someone suggest. I create a cgp symlink in cgp drirectory point to cgp directory itself. And it's work. I will need to test abit more but seem like this work fine.

  • Glad you got it working. It definitely sounds like a misconfiguration somewhere, but there's no need to continue messing with it if it is functional now.
    – coreyp_1
    Oct 3, 2014 at 15:45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.