Against my advice, my employer hired someone from fiver.com to create an online 'Task Manager'. They were given access to our database and FTP server. When I returned to work after 5 days, a certain page on our website was no longer working. The page contains a list of all our customers with several SQL filters. If I apply one of these filters through the search.php script, it will return the following error:
Not Acceptable
An appropriate representation of the requested resource /admin.php could not be found on this server.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
Word Press is the main reason for this error. The 3rd party we hired from fiver.com installed a plug-in using Word Press. The application was, as expected, not up to a decent a standard and has since been removed from our site, but the error 406 still remains.
I have already tried creating a .htaccess page with the following content:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
With this file uploaded onto the server, the error 406 is no longer displayed.
But the browser will automatically redirect to index.php.
I am running out of ideas!
Related
I've tried to output some info from the db but I get the following error :
Internal Server Error
The server encountered an internal error or misconfiguration and was
unable to complete your request.
Please contact the server administrator at you#example.com to inform
them of the time this error occurred, and the actions you performed
just before this error.
More information about this error may be available in the server error
log.
Then I tried it with a simple php page with nothing but echo "test"; and that created the same error.
I'm guessing this might have something to do with the htaccess created by WordPress but I'm not sure how to allow this page.
I tried an HTML page and that was allowed.
We are using CWP6 and I see that the file is owned by root instead of the user... not sure how I can change this.
EDITED TO ADD WORDPRESS HTACCESS :
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
The website I'm working on went down last week from a spike in traffic (I think it was a DNS attack based on the logs).
I fixed it and have the main index page up after renaming the .htaccess to htaccess.txt in their public_html folder.
The main index is fine. It works on all the links that take the user to different sections, but when clicking through to an interior page, there's a 404 now.
I can't figure out how to reroute it.
I added
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
to the htaccess.txt, but I also get
Warning: Cannot modify header information - headers already sent by (output started at /home3/login/public_html/wp-load.php:117) in /home3/login/public_html/wp-includes/pluggable.php on line 1174
when hitting wp-admin.
EDIT: after digging in on the PHP files, we realized it was a malware attack that started the whole thing. We got the htaccess and 403/404 stuff fixed, but since we're launching a wholly new site soon (on Rails rather than WP), there's not a lot of sense in digging through corrupted PHP. Thanks for all your help, folks.
Inspect both the files mentioned in the error. Likely wp-load.php has been hacked, and even though the nastyness may have been removed, it is sending output to the browser BEFORE WP tries to start a session. Inspect those files, check for blank lines before and after the opening/closing PHP tags. You might also consider downloading ALL files that make up that site and running a good virus scanner over it all.
I am new to URL Routing so this issue might be from something which I did wrong. I am using PHP and I need to have simple clean URLs without showing the .php extension in browser. So I used the routing engine from the fat free framework (f3) and added a .htaccess file to the root folder. I followed a tutorial on this and this is the content on my htaccess file.
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^(.*)$ framework.php [L,QSA]
So i need to redirect all request to framework.php file if no physical file or directory is matched.
Everything was working fine with this, but I recently tried indexing with google and as it turns out robots get a 403 error when the url of the website is given.
For example www.abc.com works fine on browser but gets a 403 error in fetch as google tool. The error is occurring in google page speed insights as well.
When you try to access it as www.abc.com/benefits/ again it works fine on browser but get a 404 error in fetch as google tool.
My robots.txt file contains the following
User-Agent: *
Disallow:
Allow: /
The error make sense if no URL routing is present because I do not have a index.php file and no physical sub directory called benefits. But since I have the rewrite rule I cant figure out why its giving the 403 and 404 errors and why only for robots.
Could any one tell me what’s I am doing wrong? Thanks
As w3d pointed out the problem is not only for the robots and there was nothing wrong with the htaccess file.
The problem was with my main controller which is framework.php
I renamed that to index.php and now the issue has been solved. For some reason even though the url and folder structure is virtual, the server is looking for a index file in the root folder.
I want to show my 404 error page when ever someone gets on a non working / non created page. After a long time of searching on the web I couldnt find any solution so I post one myself. I dont have any .htaccess file either i created it filled it in but in my FTP it kept saying nothing was safed in there and it didnt show any bytes so thats something im also worried of.
So how can i get my .htaccess file to work and show my 404 Error page template? I followed all the steps to make a 404.php file but i dont mind it to be redirected to the same template I made for it but then as a page any of those solutions is fine.
You've got some rewrite rules in your .htaccess file that are preventing a 404 error from every truly happening...
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
That basically states that if the requested resource is neither a file nor a directory (basically a 404 error), redirect to /index.php
Try this in your .htaccess:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
# delete the line below to have /index.php/anything trigger a 404
RewriteRule ^index\.php$ - [L]
</IfModule>
# END WordPress
#404 redirect
ErrorDocument 404 /httpdocs/wp-content/themes/avian/404.php
Note
This may make Wordpress quite unhappy however, I'm not sure how it uses internal routing, it may rely on breaking 404s to determine which pages to load by using fake (RESTful) URLs - reinstating 404 errors make cause Wordpress to stop working properly ... I am, however, no expert on it having barely ever touched it.
I am using a PHP application I downloaded, and it is half working on my server, however I am having what I believe is a re-write error.
The application is a "job board" where people will be able to browse available positions, and apply online.
Currently it is "technically" working. A person can view the site, and postings, and they can fill out the application form. The message is sent properly.
The problem is that once the submit button is pressed the browser shows that the page is loading, but nothing ever loads. So the message is sent, but the following page is not loaded.
The application uses htaccess rewrites, and I believe this is where the problem is.
The application is supposed to work out-of-the-box on a top level domain, however I am trying to use it on a subdomain. Am I correct in assuming that technically there is not much difference when using a subdomain? After all, the pages all load fine until the form is submitted.
The application is running at http://volunteer.essentialtransit.com
What you see is the application after initially being set up, and I added one sample "job".
You can try applying to see the problem I am referring to. It is a very simple application form that only takes a few seconds to complete.
Here is the htaccess file:
# AddType x-mapp-php5 .php
# AddHandler x-mapp-php5 .php
RewriteEngine on
Options +FollowSymlinks
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . index.php [L]
ErrorDocument 404 /page-unavailable/
<files ~ "\.tpl$">
order deny,allow
allow from none
deny from all
</files>
Perhaps if someone can explain what the htaccess rules are doing I can figure out the problem.
EDIT: So the page actually does load, but only after a very long time. The browser shows that the form is sent, and then following page starts to load, but then it takes minutes to actually load. All other pages on the site load quicker than that. The other strange things is that when a "job" page is initially opened it loads quick, after applying it just redirects back to the same "job" page, however this time it takes forever to load.
Rules are self explanatory:
RewriteEngine on # Enables rewrite engine (obviously)
Options +FollowSymlinks # Tells Apache to follow symbolic links
RewriteCond %{REQUEST_FILENAME} !-f # Here it redirects non-files
RewriteCond %{REQUEST_FILENAME} !-d # and non directories
RewriteRule . index.php [L] # to index.php
ErrorDocument 404 /page-unavailable/ # Sets 404 page address
<files ~ "\.tpl$"> # Denies access to templates
order deny,allow
allow from none
deny from all
</files>
I doubt your issues have something to do with these rules.