Hello,

We are migrating an exisiting Drupal site from one server to another and all seems well. We have no errors or warnings regarding the software versions. We can edit content without issue.

However, when we click Create Content we get a 404 "The requested URL /node/add was not found on this server."

So I tried disabling Clean URLs and got a 404 for https://mysite.com/?q=node/add

Re-enabled Clean URLs (hoping the htaccess would be re-written and maybe corrected?) same problem.
Anyone run into this before?

Any advice most appreciated!

David

Comments

pbarnett’s picture

Are you sure you copied the .htaccess file over when you did the migration?

Pete.

jerrygarciuh’s picture

Hi Pete,

Yep sure did. And without the mod_rewrite instructions there Clean URLs would fail. And all the other clean URLs work fine eg http://mysite.com/visitors/maps

Here's the .htaccess contents:

#
# Apache/PHP/Drupal settings:
#

#added by rod
AddType x-mapp-php5 .php
php_value memory_limit 128M


# 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

# Make Drupal handle any 404 errors.
ErrorDocument 404 /index.php

# Force simple error message for requests for non-existent favicon.ico.
<Files favicon.ico>
  ErrorDocument 404 "The requested file favicon.ico was not found.
</Files>

# 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 can be accessed both with and without the 'www.' prefix, you
  # can use one of the following settings to redirect users to your preferred
  # URL, either WITH or WITHOUT the 'www.' prefix. Choose ONLY one option:
  #
  # To redirect all users to access the site WITH the 'www.' prefix,
  # (http://example.com/... will be redirected to http://www.example.com/...)
  # adapt and uncomment the following:
  # RewriteCond %{HTTP_HOST} ^example\.com$ [NC]
  # RewriteRule ^(.*)$ http://www.example.com/$1 [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 and adapt the following:
  # RewriteCond %{HTTP_HOST} ^www\.example\.com$ [NC]
  # RewriteRule ^(.*)$ http://example.com/$1 [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 /drupal-6.6
  #
  # If your site is running in a VirtualDocumentRoot at http://example.com/,
  # uncomment the following line:
  RewriteBase /

  # Rewrite URLs of the form 'x' to the form 'index.php?q=x'.
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteCond %{REQUEST_URI} !=/favicon.ico
  RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
</IfModule>
pbarnett’s picture

What's the URL? Does node/add/page work? This is a strange one...

Pete.

jerrygarciuh’s picture

Hi Pete,

In preparing to post URLs I found that http://mysite.com/node/add/ works fine but https does not.

I am assuming this is a hosting issue. Would you agree?

David

jerrygarciuh’s picture

Hi Pete,

In preparing to post URLs I found that http://mysite.com/node/add/ works fine but https does not.

I am assuming this is a hosting issue. Would you agree?

David

pbarnett’s picture

Yes, I'd be almost certain of it.

Pete.

jerrygarciuh’s picture

Thanks for your time on this. When I get it sorted I'll post the final analysis here.

jerrygarciuh’s picture

Hi Pete,

Yep, it was a hosting issue. This box is admin-ed under Plesk and the solution was to go to Domains > myDomain > Set Up and check the box for Use a Single Directory for Housing SSL and non-SSL Content.

Wasn't familiar with the "feature".

Thanks for looking at it and advice!

David