I have recently renamed the root folder of a development Drupal site from:
www.example.com/foo/
to
www.example.com/bar/
The site stayed on the same host. During this开发者_如何学C transition, I made sure to include the .htaccess file. I also updated $base_url in sites/default/settings.php to the new filesystem path. As a result, The homepage works just fine, and all hyperlinks on the homepage go where they should ( example.com/bar/content/ ). Unfortunately, clicking on any the hyperlinks sends me to an error page:
Not Found
The requested URL /foo/index.php was not found on this server.
This looks like a misconfiguration, but all sources I can see only site the .htaccess file and $base_url as possible points of failure. What else should I be checking? Thanks.
I just looked around and found the error in my configuration.
There was a joomla Page before, and I wanted to replace it with my (local) new version (drupal) of the page.
I renamed the old directory and copied all files to the same directory again, so my vhost will work with the new drupal page.
Looking for hours, I found that in my vhost configuration I didn't allow Overriding:
<Directory /var/www/xxx/>
Options -Indexes FollowSymLinks MultiViews
**AllowOverride None**
Order allow,deny
allow from all
</Directory>
AllowOverride None --> AllowOverride All
And it just works... :-)
Props to Shoaib Nawaz for suggesting that I look at my .htaccess file again. My RewriteBase variable within my .htaccess file was still referencing the old location.
Old configuration:
# RewriteBase /foo
New configuration:
RewriteBase /bar
Note that if 'foo' was a default directory name, such as 'drupal' or 'acquia', you will need to uncomment the RewriteBase line and modify it to match your new (nondefault) directory name. This was the case for me, so I didn't even think to check this aspect.
Try clearing your cache. You may have to do it manually in the database. Here's a page that gives a few options: http://drupal.org/node/42055. Here's another way of doing it: http://drupal.org/node/152983#d6.
Which OS and database are you using? Do you have access to the shell and a management interface for your database?
It sounds as through you have hardcoded /foo/ to various resources, and you'll have to search through your database and source files to find these settings.
I did a quick search on Google for "moving an installed drupal directory, and the from what I read, it seemed rather difficult. It would seem that you're not only one with this issue.
http://www.google.co.uk/m/search?pbx=1&aq=f&oq=&aqi=-k0d0t0&fkt=67&fsdt=9875&q=move+an+installed+drupal+directory
I just had the same problem. In addition to Max`s answer, Check the httpd.conf file in the apache settings directory if rewrite module is enabled or enable it from Cpanel.
Drupal site worked but when I tried to access Drupal's back-office, I couldn't, so, in order to solve thethis issue, I`ve also enabled in the production server the following modules as they were enabled in my test server:
access_compat_module
actions_module
alias_module
allowmethods_module
asis_module
auth_basic_module
auth_digest_module
authn_core_module
authn_file_module
authz_groupfile_module
authz_user_module
autoindex_module
cache_disk_module
cache_module
cgi_module
dir_module
env_module
file_cache_module
include_module
isapi_module
log_config_module
mime_module
negotiation_module
rewrite_module
setenvif_module
userdir_module
vhost_alias_module
And finally, it worked. I hope this will be helpful. Greetings! :D
精彩评论