3

I am new to Drupal. I developed a site on a server and now migrating it on my personal computer (Windows 8.1). The site is working fine as it should.

My problem on localhost is that when I log in to my site (using this url: localhost/drupal_site/user/login) with an admin userid, it redirects me to the "404 Page(url: localhost/drupal_site/user)" on submission of correct username/password, And neither the admin menu bar occurs on the site.

I've tried modifying .htaccess, httpd.conf, cleaned cache tables in database and clean urls etc.

In .htaccess i've write:

'RewriteBase /drupal_site'

In httpd I've wrote:

<Directory "C:/xampp/htdocs/drupal_site">    
    AllowOverride All     
</Directory>    
AccessFileName .htaccess    

Its ironic that I've tried various solutions found with drupal community, but none of them really worked for me.

My Drupal Version is 7.26.

Xampp: Apache/2.4.10 (Win32) OpenSSL/1.0.1i PHP/5.6.3

Can anyone help me resolving this?

  • Did you enable clean urls in admin/config/search/clean-urls ? – No Sssweat May 20 '15 at 9:27
  • Yes they are already enable, I've double checked them in database. PS: I cant access admin menu to modify anything, that's my issue. – Muhammad Mustafa May 20 '15 at 10:32
  • You should make it clear that /user/login worked, clean urls work, and your problem occurs after you're redirected. It could mean that your template is doing something for logged-in users that is invalid when running on localhost (wrong URL somewhere). If you can't clear the cache with drush you could go directly inside the database using phpmyadmin or the mysql cli. – Ben May 20 '15 at 10:41
  • /user/login works fine, clean urls also work fine. I've also cleared all the cache tables in database but the problem remain same. Site return me to 404 when the login is success, and in case of wrong login id/password site tell me that my login/password are wrong. So how can I debug this (wrong URL somewhere) in my site? – Muhammad Mustafa May 20 '15 at 10:53
  • do you have $base_url set in /default/settings.php? if it's set wrong now that its on a local host, this could be causing that behaviour – Geoff May 21 '15 at 3:50
1

This issue might be a variation of the question about "drupal /?q=user is working but /user not working". So verify if you can use an URL containing ?q=user or ?q=admin. If that gets you going, then probably tuning RewriteBase in your .htaccess (as described in the accepted answer of that question) should help.

It might be worth trying to further enhance your .htaccess file, by adding a line after that existing RewriteBase, which looks like so:

RewriteRule . index.php [L]

For more details on the above line, refer to the (accepted) answer in this question on StackOverflow.

Another option for debugging is to retry using another browser. If via that brower you are able to login, then it's probably a cookie problem (in your original browser).

If none of these suggestons help, then re-edit your question by adding more details about which modifications to your '.htaccess file, httpd.conf, etc' you already tried (and didn't work).

PS: Are you aware of the security issue fixed in Drupal version 7.32? Hurry to get your "site on a server" (as in your question) upgraded to the most Drupal core version!

  • Thanks for the quick help Sir! I've tried different browser but the issue is same. As far as urls are concerned '/user' or '/?q=user' both return me '404'. And I have modified the question as you told me to be more specific. – Muhammad Mustafa May 20 '15 at 10:06
  • @PierreVriens: No I didn't get the solution, I moved along instead. – Muhammad Mustafa Jul 21 '16 at 7:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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