I have uploaded ZF on shared hosting but It's only indexcontroller and indexAction is working for rest it's showing "404 Page not Found".
Site is working fine on local server.
What can be the issue? Please help me.
The mod_rewrite rules are not being applied. Mostly likely cause is that your web server is not setup to read .htaccess files (which is where the ZF rewrite rules are specified by default). Compare the setup for the Apache variable AllowOverride between your two environments.
my guess is .htaccess missing, or permissions on it, etc. resulting in a routing issue. check the "non pretty" url to see but I'm guessing you'll reach the pages without a problem.
Related
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.
I am trying to create a new domain which runs on SilverStripe 3.0. I am unable to figure out the issue. If I upload a custom php page then it runs fine, but my website is not working. It shows blank page but shows the favico.
If I try to open up www.mydomain.com/admin/, I get the error
Page Not Found
The requested URL /admin/pages was not found on this server.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
This is not a Silverstripe error page. Here is my php info Info
Please let me know if I am missing something or there is any way to figure out the issue.
Try www.yourdomain.com/index.php/admin
If that works then it is because your rewrites are not working. This can be because .htaccess isn't configured properly, or because .htaccess is not used at all (in which case you need to edit your server config).
Last I used Plesk it always used apache. If that is different now and you're using nginx as more than a forward proxy, then you will need to set up the redirects for your site manually.
It does sound like your .htaccess is not being respected. Does Plesk allow overrides for .htaccess in the local directory?
At an apache level we would have something like this stanza to ensure the the .htaccess of the project was respected;
AllowOverride All
If your .htaccess is being processed, make sure that your host has mod_rewrite enabled as that is required to access to pretty URLS.
At the moment I am trying to move a website to a new web server. The site uses CodeIgniter and on the old server, every route worked. On the new server none of them are working, even though I copied the entire website from the old server. This means there are no differences in .htaccess files, since the two servers contain the exact same website. Not even the default routes are working, just the home page (index.php). I included the code in .htaccess to remove 'index.php' from routed URLs, but that also does not work.
If I try to visit '1.1.1.1/~user/employees' it will give me a 404 error, which means that the CodeIgniter route is not working. The controller file is located at /application/controllers/employees.php, so I am not sure what causes the problem.
I am aware of the similar posts on the site here, but none of them could solve my problem. Configuration of the config/config.php is (partly) as follows:
$config['base_url'] = '1.1.1.1/~user';
$config['index_page'] = '';
$config['uri_protocol'] = 'AUTO';
I have tried to change the base_url, but it still does not work if it's empty. Changing uri_protocol to REQUEST_URI or PATH_INFO also does not work. Also, if I try 1.1.1.1/~user/index.php/employees (so put 'index.php/' in between) I still cannot reach the page. I checked some Apache settings as well, AllowOverride is set to ALL and the mod_rewrite module is installed and enabled. Is there perhaps something else concerning differences in both server's configurations that I could have missed?
EDIT:
I think I am a bit closer to finding out what the problem is. It is either something with Apache or .htaccess (but I already tried many things) or it has to do with the fact that the server URL is 1.1.1.1/~user rather than 2.2.2.2 as it was on the old server. Maybe I should change the baseurl or location of my .htaccess? This looks similar to my problem, but moving the .htaccess did not fix the problem: Url routing errors in php in codeigniter. I might try re-installing Apache.
I think that you firstly should find out what happened.
All requests to CI go through index.php, so you just echo something and exit in index.php file at the first line.
If the page display what you echoed that means there is something wrong in CI, otherwise that's not because of CI. And you can focus on what cause the problem.
Sorry about my English.
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.
I have: brand new clean copy of Kohana 2.3.4 (tried 2.4 RC1 also), a controller named 'index' on a Debian with Apache 2.2.9.
When i type address like http://localhost/kohana/index/index i expect controller 'index', action 'index' to be executed. It works on Windows localhost, works on shared hosting. But does not on my Debian server.
I've debugged and found, that $_SERVER['PATH_INFO'] isn't correct. It omits the first 'index' in the URI, so i can get to 'index/index' by going to 'index/index/index'. So that is what i want to fix.
Does anybody know how this could be solved?
I'm guessing it actually occurs in your .htaccess file or Apache config, not Kohana specifically. First of all, make sure that the example.htaccess file that comes with Kohana is renamed to .htaccess, and you may have to restart Apache.
If you are using .htaccess to hide the index.php part of the path, check to see what the RewriteBase setting is:
RewriteBase /kohana/
If you installed it in the root of your web server (as in production, or using a separate port for localhost), then it should be changed to:
RewriteBase /
This is my own personal most common error in setting up new sites and development environments, by the way. This is also true for CodeIgniter and other related PHP frameworks.
Does your Apache install on the Debian server actually have mod_rewrite? It would be good to confirm that. Here's one way to do that.
Further diagnosis to see if it is Kohana or Apache's fault includes adding back in the index.php portion of the path. In your case, try http://localhost/kohana/index.php/index. Finally, I have to agree with sarfraz above that naming your controller "index" is just begging for trouble. My own convention is to call it "home" and to edit the default route accordingly.
It turned out to be mod_negotitaion. It damn mod rewrites my /index/index to /index.php/index, cause it thought i've missed .php
So anyone who encounter this issue, just disable mod_negotiation and have a good time