Wordpress Permalink change won't work - php

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.

Related

Silverstripe not working on Plesk Server

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.

CodeIgniter routing - 404 error after moving to new server

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.

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.

ERR_INCOMPLETE_CHUNKED_ENCODING Chrome Root page load

I have a website on a lamp stack with little to no extra configuration other than FallbackResource /index.php present in my root .htaccess
When I load the root page (localhost ) in Chrome I receive
GET http://192.168.163.171/ net::ERR_INCOMPLETE_CHUNKED_ENCODING VM110:1
in the chrome console after about 10 seconds. If I attempt to follow the link at VM110:1 it takes me to the top of my inline Javascript.
More information / What I've tried
This does NOT occur on any other page but root
There are no 404's in the access log nor any other abnormal codes
There are no errors appearing in the apache error log.
The error does not occur in the latest version of IE or Firefox.
It caused a problem in both my local environment and hosted. The latter has absolutely no config changes and I expect to be a near default install.
When I remove the FallbackResource directive my page loads fine without the error
In index.php the root is treated no different than any other page.
This would all be a non-issue because everything loads properly BUT it prevents javascript relying on a finished page load from working.
Any further ideas on what is causing the problem or new things I can try? I've considered moving to just using mod_rewrite but this is much simpler.
Finally found the answer while working on another site:
Before FallbackResource directive be sure to add a DirectoryIndex directive with the same file. Haven't had time to research why but it fixed my issue. I blame it on a Chrome bug or possibly Chrome being super picky because no other major browser has an issue.
I fixed this error by removing the following lines from my php5filter.conf file in the Apache configuration:
<FilesMatch ".+\.ph(p3?|tml)$">
SetInputFilter PHP
SetOutputFilter PHP
</FilesMatch>
To add to Blaine's answer (as I can't yet comment):
I believe this is an Apache configuration issue, not specific to Chrome.
I recently experienced this issue, and noted the following effects in various clients, again only with the home page:
Chrome, as stated, displayed the ERR_INCOMPLETE_CHUNKED_ENCODING error, but also didn't display the page correctly. The page continued to "load" for another 5 seconds even after all the content was visible.
A simple CURL request outputted the error curl: (18) transfer closed with outstanding read data remaining. The full HTML appeared, followed by the error after a delay.
Firefox and IE initially displayed the page incorrectly, as with Chrome, and again had the ~5 second additional loading time. However, after this period, the page suddenly reformatted itself correctly. No errors were seen in the respective developer consoles.
The solution to set the DirectoryIndex to the same location as FallbackResource resolved this for all clients.
Edit: An alternative if using mod_rewrite is to use something like RewriteRule ^$ index.php which will avoid affecting all subdirectories.
I don't know whether this is expected behaviour of Apache or a bug.
In my json response '\n' causing the issue. So after removing it, issue has been solved.

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.

Categories