Wordpress - Only Serving Physical Files After Server Switch - php

I am helping someone move their WordPress site from a (truly) wretched Dotster shared plan to a VPS.
Everything is transferred and working, except Apache is only serving physical files like index.php and wp-admin/, etc... Other directories on the site will return a 404 error.
I am guessing this has to do with Apache ModRewrite, but I am truly unsure at this point.
Halp!

It looks really like a problem with rewriting.
Make sure you copied your .htaccess files
Make sure Apache mod_rewrite is enabled (for example by running a2enmod rewrite under debian)
Make sure overrided by .htaccess are enabled (AllowOverride All directive in Apache Configuration)
Overrides will make Apache look in .htaccess files. See http://httpd.apache.org/docs/2.2/mod/core.html#allowoverride
Hope it helps!

Related

Do i need to restart Apache after changing the settings.php file of a Drupal website?

I wanted to know the answer before I make the changes on a production server:
Do I need to restart Apache after changing the settings.php file of a Drupal website?
Simple answer is NO, as it is .php it is not cached by Apache it is not php.ini or something like that, Apache is caching only its own configs and settings.php is Drupal settings

zend framework 2 project in server doesn't work

Working with zf2, we have configured the project successfully in local env, we deployed the same code to server, but there..only the IndexController action is working.
like www.project.com/public/ works,
but when I access other modules like
www.project.com/public/country doesn't work.
This means the mod_rewrite rules to rewrite all requests to your index.php file are not being used. Generally this means either:
The .htaccess file was not uploaded (check the public folder on the server to see if it's there)
The .htaccess file is being ignored (check AllowOverride for the vhost on the live server)
Also, really public/ should not appear in your URLs. Unless you are using shared hosting (where this can be tricky), you want to point your vhost's document root at the public folder.
In a proper Zend setup an error should come from Zend. When you get an error like this, returned from Apache, your apache configuration is not working. Your Zend application isn't even considered, i.e. the index.php in your public folder.
It's a save guess that your [public/].htaccess isn't used. Check your apache web configuration. Most likely you're missing the AllowOverride All statement which is usually inside the <Directory> statement.
And as mentioned by Tim you really should not have public/ in your path to begin with.

EzPublish 5 friendly URL's won't work

i have set up a local EzPUblish 5 installation, and it seems to work, with one exception: friendly URLs.
When I go to http://arabia.local/index.php/Frontpage, it works, but if I go to http://arabia.local/Frontpage, it tells me 404 not found.
I did some research already; I copied the .htaccess_root to .htaccess, I set the ForceVirtualHost=true in site.ini, I checked in my httpd.conf that AllowOverride All is set - I am running out of ideas here.
The files and settings you mentioned mostly concern eZ Publish's legacy part and will most likely have no effect on the frontend.
From what you're describing, the first thought that came to me was that the VHost configuration might be not complete. Please compare your configuration with the one eZ Systems officially provides: Virtual host setup and .htaccess example.
Are you perhaps missing the following line?
RewriteRule .* index\.php
Please also keep in mind that your webserver's root must point to the "web" directory, and if you are not using a VHost based configuration, the .htaccess file must reside in the "web" directory (but to be honest, I haven't seen a non-VHost based setup yet, so I'm not sure about the .htaccess method.
Nonetheless there should be no need to change anything in the "ezpublish_legacy" directory, especially not for an initial setup.

Apache mod_rewrite does not work although loaded

My application worked with .htaccess when it was on localhost
When I uploaded the application to the server, the .htaccess is not working.
Through phpinfo(); I noticed that mod_rewrite is loaded under apache2handler.
I suspect my .htaccess rule maybe wrong, so I tested with
http://www.webune.com/forums/viewtopic-p-62.html
but it still didnt work, the 404 page is showed.
What should be the valid reasons for above problem?
Thank you so much for your help :)
I would guess that AllowOverride is set to None or something that is preventing you from controlling mod_rewrite within an .htaccess file. You're going to need to be able to modify Apache's config to change that.
Here's how you test it: How To Check If mod_rewrite is Enabled in Apache
If you have access to your Apache config files, look at http://httpd.apache.org/docs/2.1/howto/htaccess.html.
Check the AccessFileName parameter if it is .htaccess. It should be by default. If it is, then it is a problem with the site configuration. Refer to Jonathan's answer for that solution.

Why can't my browser see my hosted php files?

I'm sure I'm doing something dumb, but I can't tell what it is.
On my remote host, I have a subdir with a bunch of files.
When I request this directory, I can see a listing of the files within this dir.
However, if request any file suffixed .php, my browser says that the resource is not available. Firefox tells me that it can't find the file I requested.
I guess that this is a permissions issue.
For testing purposes, I have set the permissions as permissively as possible.
What could be causing this?
Resource not available (HTTP 503) depends a lot on your server configuration. If you are using a FastCGI version of PHP, have you started the FastCGI backend? If you are using Apache and mod_php, are there errors in the Apache logs?
What web server are you using? Has it been able to serve PHP files before?
if apache, make sure you have something similar to this in your config:
<IfModule mod_php5.c>
AddType application/x-httpd-php .php
</IfModule>

Categories