I created a localhost install of drupal to test various things. It worked fine. I had both 5.7 and 6.2 working, both with no added content. These exist as:

http://localhost
(6.2)

and

http://localhost:/drupal-5.7
(5.7)

For the 5.7 version, I specified the base url in settings.php (and I looked at the .htaccess file, but all looked OK in there).

I then backed up the online version of the 5.7 database (from rosslaird.com) and restored it to the localhost version. All content appears to be there, but all urls with the basic syntax fail. So,

"http://localhost/durapl-5.7/blog" fails

but

"http://localhost/durapl-5.7/?q=blog" works perfectly. All urls with "?q=" work perfectly; all others result in 404.

This is surely something very simple that I have overlooked. I tried various options in the .htaccess file (uncommenting and commenting various things), but no sucess.

Suggestions are welcome.

Ross

Comments

doka’s picture

Do you have the ".htaccess" file in your root?

Doka

Doka

rosslaird’s picture

Yes:

#
# Apache/PHP/Drupal settings:
#

# Protect files and directories from prying eyes.
<FilesMatch "\.(engine|inc|info|install|module|profile|po|sh|.*sql|theme|tpl(\.php)?|xtmpl)$|^(code-style\.pl|Entries.*|Repository|Root|Tag|Template)$">
  Order allow,deny
</FilesMatch>

# Don't show directory listings for URLs which map to a directory.
Options -Indexes

# Follow symbolic links in this directory.
Options +FollowSymLinks

# Customized error messages.
ErrorDocument 404 /index.php

# Set the default handler.
DirectoryIndex index.php

# Override PHP settings. More in sites/default/settings.php
# but the following cannot be changed at runtime.

# PHP 4, Apache 1.
<IfModule mod_php4.c>
  php_value magic_quotes_gpc                0
  php_value register_globals                0
  php_value session.auto_start              0
  php_value mbstring.http_input             pass
  php_value mbstring.http_output            pass
  php_value mbstring.encoding_translation   0
</IfModule>

# PHP 4, Apache 2.
<IfModule sapi_apache2.c>
  php_value magic_quotes_gpc                0
  php_value register_globals                0
  php_value session.auto_start              0
  php_value mbstring.http_input             pass
  php_value mbstring.http_output            pass
  php_value mbstring.encoding_translation   0
</IfModule>

# PHP 5, Apache 1 and 2.
<IfModule mod_php5.c>
  php_value magic_quotes_gpc                0
  php_value register_globals                0
  php_value session.auto_start              0
  php_value mbstring.http_input             pass
  php_value mbstring.http_output            pass
  php_value mbstring.encoding_translation   0
</IfModule>

# Requires mod_expires to be enabled.
<IfModule mod_expires.c>
  # Enable expirations.
  ExpiresActive On
  # Cache all files for 2 weeks after access (A).
  ExpiresDefault A1209600
  # Do not cache dynamically generated pages.
  ExpiresByType text/html A1
</IfModule>

# Various rewrite rules.
<IfModule mod_rewrite.c>
  RewriteEngine on

...

  # If your site is running in a VirtualDocumentRoot at http://example.com/,
  # uncomment the following line:
  # RewriteBase /drupal-5.7 (tried this both ways, commented and not commented)

  # Rewrite old-style URLs of the form 'node.php?id=x'. (tried all these)
# RewriteCond %{REQUEST_FILENAME} !-f
# RewriteCond %{REQUEST_FILENAME} !-d
# RewriteCond %{QUERY_STRING} ^id=([^&]+)$
# RewriteRule node.php index.php?q=node/view/%1 [L]

  # Rewrite old-style URLs of the form 'module.php?mod=x'. (and these)
# RewriteCond %{REQUEST_FILENAME} !-f
# RewriteCond %{REQUEST_FILENAME} !-d
# RewriteCond %{QUERY_STRING} ^mod=([^&]+)$
# RewriteRule module.php index.php?q=%1 [L]

# Rewrite current-style URLs of the form 'index.php?q=x'. (and these)
# RewriteCond %{REQUEST_FILENAME} !-f
# RewriteCond %{REQUEST_FILENAME} !-d
# RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
</IfModule>

# $Id: .htaccess,v 1.81.2.4 2008/01/22 09:01:39 drumm Exp $

Also: all the settings worked before the restore. I also have another .htaccess file (for the 6.2 version) in the directory above. The base url is set for the directory (localhost:/drupal-5.7) in which the above file exists. Also: i was using the secure pages module, and had to remove the folder in which it was placed (since https does not exist on localhost). I don't know if this is a factor.