Silverstripe not working on Plesk Server - php

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.

Related

Error 404 while opening site, httpd.conf?

I have a php application that I needed to open on a local web server. I'm running Windows 7 on my VM. Have installed php 7.3.6, mysql, apache 2.4.
After some configuration trying to open my "application" with "localhost/application".
Getting "Internal error 500".
In Apache logs can see "C:/WebData/application/.htaccess: Invalid command 'order', perhaps misspelled or defined by a module not included in the server configuration"
In .htaccess I have:
order deny,allow
RewriteEngine On
RewriteBase /
RewriteRule .* index.php?url=$0 [QSA,L]
Change first line into "Require all granted"
Trying to open "localhost/application"
Getting the error "404 URL /index.php" not found
Trying to open "localhost/application/index.php"
Forwarding to "localhost/ru/main"
Getting another error "404 URL .." not found
Also after each request I see that htaccess is changing back into its initial state with "order deny,allow".
Is there something wrong with httpd.conf?
You probably don't run mod_access_compat, which means Order is not available, as it's deprecated in Apache 2.4 (see https://httpd.apache.org/docs/2.4/howto/access.html)
Now, the reason why your .htaccess files get overwritten probably lies in the PHP code you're running. Some applications try to auto-configure themselves and will write their own .htaccess file to make sure they run properly.
The fact this particular app tries to write deprecated commands without checking if the version of Apache you are running is capable of handling them is concerning and probably means it's outdated.
Do a global search on the application files and look for that Order deny, allow rule, I'm pretty sure you'll find the culprit.
If you can run a newer version of that code, do so, and if not, and if patching it manually is an option, change it to Require all granted

Wordpress Permalink change won't work

I want to update my permalink structure to postfix from the "plain" type, but every time I try--I get a 404 on every page I try to visit, except for the front page. I've reset my .htaccess, deleted it and recreated it, disabled all plugins, and then tried redoing the .htaccess with the plugins still disabled--but no luck.
I do think this was caused by the "Team" plugin by pickplugins...but still no luck when deleting that and redoing the above.
Any ideas?
Thanks!
Make sure server enable Apache Mode Rewrite properly. This happen all apache servers doesn't install Mode Rewrite.
I would begin by testing whether or not the htaccess file you are editing is being used by the Apache server. To test this, break it intentionally (writing invalid lines of codes can achieve this). Then see if you get the 500 Internal Server Error on your page. If you get that error, then that means your htaccess file is in fact being used by the server.
if the htaccess is working then find out if mod_rewrite is working on your server.

Sub-pages always open domain root

I'm having a strange problem with a new PHP page I´m writing. Everything seems to be loading/redirected to the domain root page.
domain.com loads fine
domain.com/page or domain.com/page/index.php always loads "domain.com" while retaining the /page/index.php in the browser URL.
Even domain.com/some_random_text loads "domain.com"
I suspected the .htaccess file, but there is none to be found. There are no redirects in the PHP code.
If I remove the domain.com/index.php file I get an Internal Server Error when opening domain.com/page/index.php
This domain did have Wordpress installed, but I did uninstall that via cPanel.
First thing to notice is that the .htaccess file can be anywhere in the path that is handled by Apache. So check everywhere. This kind of redirect could be made only like that.
This can only be done by Apache, so you might also like to check the apache config if you are running on a virtual machine or dedicated server.
Also, not that it might have been a wildcard redirect, added by the cPanel, so check those settings. Though I think those actually just modify the root .htaccess file.
Based on the data you provided I cannot say more, but I don't think this is a common issue.

Codeigniter on IIS web.config issue

I am installing a site made in PHP/CodeIgniter 2 on a hosting server which unfortunately has IIS running, which I have no experience in.
Nothing is working except the homepage, all other pages are returning 404 errors.
Adding index.php to the url returns 500 - Internal server error (I have the index page config set to '' in the config.php file)
I tried also creating a web.config file thinking the issue might be from the redirects, but adding a web.config file stops even the homepage from working, even if the web.config file added is completely empty.
Help really appreciated.
Check if the hosting server has Re-write module installed in it, that could be your problem.
Make sure you had installed URL Rewrite -
http://www.iis.net/downloads/microsoft/url-rewrite
After you had installed the module you should able to see this icon (URL Rewrite) in your IIS Management.

ZendFramework - only indexcontroller indexAction is working

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.

Categories