Drupal migration - now only front page works - drupal

I just migrated a Drupal site from a ISP
to a dedicated Linux CentOS server.
MySQL Database is configured and generates front page without error.
Problem is that only the home page works.
All other pages show "404 Page Not Found Error".
So mysite.com/ works
but mySite.com/node/1 does not work.
I checked some obvious places:
LoadModule rewrite_module modules/mod_rewrite.so
is enabled in httpd.conf
Any ideas?

I've had this happen before. It could be because your new Linux Centos OS server isn't configured for clean URLs yet.
Try to access the site as follows. To login:
http://example.com/?q=user/login
Login as admin and submit the form. You'll get access denied 404 page again after submission but still login.
Now manually type and go to http://example.com/?q=admin/settings/clean-urls
On this page turn off clean-urls and save and you should be able to access your site normally on the new server. Just configure it for clean-urls and then turn it back on when it's ready.

thanks Kevin,
mysite.com/?q=node/1? gives me a 404.
.htaccess was indeed missing. I copied in a generic version from a
vanilla install into root directory (same directory as index.html) and this does not help.
(I don't have access to old site. We did not modify .htaccess - so I assume vanilla copy will do)

Another possibility: If it's a new server, make sure that Apache has mod_rewrite installed. Happened to me.

If you have drupal 7 or higher use this for the clean-url config page:
mysite.com/?q=admin/config/search/clean-urls

Check to see that the .htaccess file made it through the migration. Usually the culprit here. Can you get to mysite.com/?q=node/1?

Related

index.php is bypassed in wordpress local install

hello I have a local wordpress installation, which is a copy of my hosted website.
i'm going to try to make it simple :
If i type "http://mylocalwebsite/index.php", it works and shows me my local copy
If i type "http://mylocalwebsite", index.php is still used, but i'm ending in my hosted web page (www.myrealsite.com)
If i type "http://mylocalwebsite" again, it doesn't use index.php, and directly opens my hosted website.
All hosts files are correct, none of them is leading to my hosted website.
I've done a search for "www.myrealwebsite.com" in the directories of the local copy : no result.
I just don't understand why. Any ideas ?
Thx
This is a cached redirect from the browser you are using (since the hostname you are using is not FQDN, the browser tries to correct that, or has previously seen a (301) redirect to the real webpage like from non-www hostname, to a www.hostname and uses that to assume what is correct).
If you try the same with CLI curl request, I would imagine the result will be as you expect.

Wordpress Pages not working on AWS

I copied my wordress site to an AWS instance. My home page is working fine, but the pages are not working properly. It is giving me a 404 error.
Not Found
The requested URL /some-page/ was not found on this server.
Apache/2.2.31 (Amazon) Server at example.com Port 80
Does anyone know why this is?
There can be multiple reasons,
First check if the site is copied properly, compare the size of the website on both source and AWS.
Check if the permissions are same as source.
Check the error logs, u can share logs
I have found the solution to my problem. In case it will help someone, here it is.
By default the Allowoveride is set to None.
1) Open /etc/httpd/conf/httpd.conf
2) Locate "AllowOverride None" inside ''
3) Change "AllowOverride None" to "AllowOverride All"
4) Restart apache server

XAMPP wordpress on localhost

I have this site and I need to test it out locally to see if there is an issue with my php settings, anyways I tried to navigate to localhost with the port number localhost:portnumber
and that worked fine, but then I tried to navigate to my site localhost:portnumber/mysite and I get a 404 error and the in the the address i navigate to changes to localhost:portnumber/mysite
Why is this happening and what can I do to fix it?
Thanks
Because you are getting a 404 error, your server seems to be running but make sure the server is the one you have setup.
1st, have you tried using a simple html file? example: blabla.html on root, and typing: localhost:portnumber/blabla.html
If this is working, that means your server is running fine, you can also try with an Hello world php file if you wish.
In the case of wordpress, there is sometime a .htaccess file that uses url rewrite and it may remove your port number, you could try to test with a clean wordpress install first.

Moved Drupal 7 site to a different server, can't log in

I recently moved my Drupal 7 site to a new hosting server and I'm stuck at the login page. As soon as I try and log in, I get directed back to the same page, but the URL changes from /user to /user/1, which leads me to believe that I am actually logged in, but I'm not being forwarded to the correct page.
I tried cleaning my cache, emptying the cache tables in the DB but nothing helped.
Any ideas?
EDIT: To make things a bit more clear, I've used the specific server for various other Drupal 7 sites, so I know for a fact that the server configuration is not at fault here.
I suspect your $cookie_domain in /sites/default/settings.php is incorrect.
Try making it match your new domain and ensure there's a leading dot .
$cookie_domain = '.mydomain.co.uk';
Sometimes problems relating to logging in after a site migration can be because mod_rewrite was enabled on the first machine but not the second. A simple way to test this is to use the ?q= URL format (http://site.localhost?q=user) and see if you can log in like that. If that works then you can either disable clean urls from within the Drupal interface, or enable mod rewrite in Apache.
In my case the issue was solved only after refreshing .htaccess file in drupal root folder.
You can take the source here: https://github.com/drupal/drupal/blob/7.x/.htaccess
seddonym's comment about mod_rewrite led me to a slightly different solution. I was having the same problem but was able to solve it by copying the file rewrite.load from /etc/apache2/mods-available to /etc/apache2/mods-enabled.
I think the files in mods-enabled are some sort of link files (I am novice at linux still) but copying the files worked just fine. Maybe someone will come along and tell us the proper way to do this.
Sometimes all you need is to clear the cookies for the domain/website - it's possible you have old cookies alive that are causing this.
Get a cookie manager to help simplify this, e.g.:
Edit This Cookie (for Chrome)
Other answer might be that rewrite php module is not installed, to do that do the followings:
sudo a2enmod rewrite
Restart apache2
sudo service apache2 restart
In my case it was very stupid, on my page.tpl.php, there wasn't any "content" and the page--user.tpl.php didn't get read. Only had the line to show content in the page.tpl.php
Although that it is unlikely that you're as stupid as me. ;) Maybe it will be helpful anyway.
Arne

Wordpress Blog :: 500 Internal Server Error

I am getting this error message while trying to access a wordpress blog which is installed in a directory. Is this due to .htaccess or something? Any help is appreciated.
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, webmaster#xxxxx.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
Apache Server at xxxx.com Port 80'
This is almost always a problem with your Apache configuration. Errors originating in PHP won’t trigger the Apache 5xx handler, which is what you’re seeing.
Unfortunately, without more information, your problem is impossible to diagnose. I’d recommend that you:
Check the logs. First thing! It should give you a better idea where your problem is.
Stop and restart Apache. If there is a problem with permissions on something Apache needs write access to (logs), it could completely fail to start. This should give you the proper motivation to fix the problem, particularly if there are other VirtualHosts on that Apache.
Move your .htaccess file(s) somewhere else. If Apache works, you know it’s a problem with that file.
It sounds like you're getting some sort of PHP error but PHP isn't set to display errors. You'll want to check your Apache logs for detailed error info.
The mostly likely culprit is that you're missing some prerequisite for running WordPress, although all you should really need is Apache, MySQL, & mod_rewrite.
I was able to fix it by adding the following line to my .htaccess file:
php_value memory_limit 128M
Russ
This is happening to me RIGHT NOW.
As to from what I know, my hosting providers did a DNS change and so I'm waiting for the DNS to propagate, it's been like three hours and still zero.
Blog is showing ok, apache is up and working, I just can't get access into the WP Admin area.
If it does get fixed by tomorrow, I'll reply here so it can be of help for others.
Edit: I just fixed my problem.
In my case it was determined that the Fast Contact Form plug-in was creating the problem. I modified the folder name from si-contact-form to si-contact-form-hold then I regained WP Admin access.
After that I created a php.ini file with this string inside 'memory=64MB' and saved that into the wp-admin folder.
Manually deleted the si-contact-form-hold (to avoid possible corrupted files) and reinstalled the Fast Contact Form.
All my settings were already there and everything is back up and running good!
Hope this helps.
Look at http://zemalf.com/1470/wordpress-htaccess-the-definite-guide/, and look for the paragraph which says something like "Good and default .htaccess looks like this...."
My issue was a little bit different. I had an .htaccess file inside the wp-admin directory. I deleted the .htaccess inside of wp-admin and that fixed my problems.
Unfortunately it could be anything. Do static pages on the site work properly.
Have you checked the server logs.
I think it is likely to do with php. If static pages are there then possibly your config for wordpress is incorrectly configured or files missing.
Has php be working? Did the blog work and then stop? Did you get through the install process?
Check wordpress files ownership for the user are correct or not.
In linux ls -laZ command will display the ownership.
For setting the ownership for a folder use this command
chown -R username:username /user/username/public_html/
An HTTP 500 error could be caused by a great many things. Have you changed your .htaccess file recently? If you try to use a .htaccess feature that is disabled on your host, that is one possible cause.
Some more points
Blog has been running successfully. Just observed this problem since yesterday.
Blog is in a directory so it works something like this www.xyz.com/blog. Apparently www.xyz.com is working perfectly.
Update on logs
Getting these two errors in the logs:
File does not exist: /home/directory/public_html/500.shtml
/home/sub-directory/public_html/sub-directory/.htaccess: RewriteCond: bad argument line '%{REQUEST_FILENAME}!-f'
/home/directory/public_html/sub-directory/.htaccess: # without matching # section
How do I restart apache on cpanel ?
memory = 64MB;
The above line inside a php.ini file uploaded to the wp-admin folder solved my problem. I was not being able to log into the dashboard either through /wp-admin or /wp-login.php, and was getting a HTTP server error 500.
There can be multiple causes for this, I just solved mine, after 2-3 hours of going crazy.
I had another WP instance in a subdirectory inside the main WP instance (in the root folder).
Have checked / deleted .htaccess
deleted plugin folder
In the end, it was to do with the permission of the subfolder in which second instance was running. It was originally 775 (write permission for group), I had to change it to 755 (no write permission for group) and this finally fixed it, like magic.
This is of course just one of possible the answers to your question, I wanted to write it down though as I didn't find it explicitly written anywhere so it might save others some time.

Resources