Joomla 2.5 no 404 page - php

I'm having issues with my Joomla installation.
It's a rather vanilla J! 2.5 (latest version) installation with K2 (I don't think it is related to my problem).
The problem is that any URL I make up (such as http://www.mysite.com/No-Such-URL-At-All) gives me the following error:
Error
Article not found
You are not authorised to view this resource.
I created an error.php file that should handle it in the template, but it is not used at all by Joomla, as I don't think it is really handled as error but as a permission redirection :\
So I tried adding this code to my template:
Code:
if (($this->error->code) == '404') {
header('Location: /404.html');
exit;
But no error was detected and the code was also ignored.
I inspected the response headers from the server, but I actually get a response 200, OK response :.
Some additional data that could be usefull
- It's hosted on a godaddy dedicated centos server
- SEF is enabled (problem continues also when disabled)
Let me know if any other information could help...
I really have no other direction I can think of, maybe someone has any idea why any 404 is turned into a permission redirection?

Check to see if when you have a 404 if Joomla is hitting the "com_content" component ( check the $_REQUEST variable). I had this problem and it turned out that it wasn't, it was hitting one of my custom components. If this is the case, here is what you need to do to fix it. For this example, lets say that its hitting 'com_home' instead of 'com_content'.
1). Copy components/com_content/router.php into components/com_home
2). Open components/com_home/router.php and replace all instances of "Content" with "home"
3). Open components/com_home/home.php and add the following lines near the top of the file:
JHtml::_('behavior.tabstate');
require_once JPATH_COMPONENT.'/helpers/route.php';
4). Copy the entire components/com_content/helpers into components/com_home
When that's done, the url mysite.com/does-not-exist should redirect to the error.php page you've set up in your template.

Related

Magento Sub Pages Shows 404 NOT FOUND Error

I am using Magento 1.9.1. I installed Magento successfully in my server. But when I navigate any subpages (example:About Us, Contact Us, Login etc) in front end it shows 404 Not Found Error. But Home page display correctly.
My home page url is something like this: http://mydomain.in/store .This display ok. My Contact Us page is : http://mydomain.in/store/contacts . This shows Not Found Error. But when I type url manually like this http://mydomain.in/store/index.php/contacts .This shows working. That is when adding index.php it became working.
How can I make this working??
Solutions I found: Change 'Use Web Server Rewrites' to NO in System->Configuration->Web->Search Engine Optimization.
This make working, but the url contain index.php like this http://mydomain.in/store/index.php/contacts. I think http://mydomain.in/store/contacts is standard and this should work(but I don't know how). Another issue is User Logging, checkout etc are not working here. To make working we can add form key in corresponding pages. But this is not preferable because many pages have to change.
Another solution is: make enable apache mod rewrite. Uncomment this line LoadModule 'rewrite_module modules/mod_rewrite.so' inside 'wamp\bin\apache\apache2.4.9\conf\httpd.conf'.
My question is How to avoid 404 NOT FOUND ERROR in Magento Subpages?
When I follow the above solutions the url path contain index.php. And the logging like features become not working.
How can I avoid index.php in url?
My folder structure is D:\wamp\apache2\htdocs\site\store. store folder contain magento files.
The home page is available in http://mydomain.in/store.
Please help me .Any help is really appreciable..
In order to avoid index.php in urls you must have mod_rewrite enabled on your server and from the Magento admin panel go to System->conguration->web->Search Engines Optimization and set the flag Use Web Server Rewrites to Yes. Clear the cache and give it a go.

Drupal Migration - Error 404's

I've set up a Drupal 7 site locally and have ftp'd the site over to my ISP's server which is a linux box running PHP and MySQL.
I've never successfully logged into the site before and I have locked myself out. When I go http://www.example.com/?q=user and click on request New Password then I get this error:
Not Found
The requested URL /user/password was not found on this server.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
One thing I've been confused about and that is the .htaccess file. I never had one locally on my Mac and I did not need it (I know it is hidden) - so I downloaded one and deployed it to the web site but then I got 500 errors, it made it worse. I've since deleted that file and at least I get some content - but not very much - just the front page. I overrode the themes name in settings.php as I have user access errors there. I changed it back to one of the default themes and that allowed me to get some content and not the 'white screen of death'
Advice welcome!

Why does my custom 404 work but not my 403?

I'm working in a Symfony 2 project (version 2.1.11 to be precise). I'm trying to customize the 403 page returned when using the Symfony firewall. It correctly returns a 403 error but not using my custom page.
I am using the template override method by putting a file at app/Resources/TwigBundle/views/Exception/error403.html.twig. I have an error404.html.twig page right next to it that works OK and is returned for non-existent URLs. I've cleared my cache and I'm testing in the "prod" environment.
Anybody able to tell me where to go next? I'm not sure why the 403 works but the 404 doesn't. If you have a custom 403 working at all, I'd also appreciate a comment on how you did it (maybe I can override that template elsewhere, etc.)

Cant login to my wp-admin after switching to SSL

I recently installed SSL certificate for my wordpress site(http to https) and now I'm unable to access Wordpress Admin. It refreshes the page and I am not logged in.
Is there something I forgot to change in my wordpress files?
I inspected the code and the login form is pointing to my old site (the http one) and when I look at the code in the file, the form action is set to site_url() and I can't seem to find where it's defined.
I had the exact same problem with my site on NearlyFreeSpeech.net, and the solution was not so simple as fixing the site URLs. That made no difference.
The underlying problem in my case, and the solution, were explained in the post copied below. Note that on my system, the SSL error created two problems, the one described here on Stack Overflow (wp-login refreshes without logging in) and a failure of WP to load stylesheets, which was the problem actually addressed in the forum post quoted below. The solution in the post solves both problems.
What you describe sounds like the browser refusing to load the
stylesheet, which typically happens when first creating an
HTTPS-enabled WordPress site or adding SSL/TLS to an existing WP site.
WordPress isn't very smart about "reverse proxies" like what NFSN
uses, where the user hits an outer web server that then talks to an
inner application server where WordPress actually lives.
If you think you have an SSL-enabled site, especially if it's a new
one, this could be your problem. You would need to edit your
wp-config.php file to add the following:
if ($_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https')
$_SERVER['HTTPS']='on';
just above the "That's all, stop editing! Happy blogging!" lines.
Conversely, if you don't think you are using SSL on your site, this
won't do anything. Check the alias for your site on the NFSN site
control panel. If you see a padlock, you're set up in NFSN and need
the code above.
WordPress's implementation of SSL is kind of a botch. It not only
doesn't recognize SSL under environments like ours - it also is prone
to redirect loops if everything isn't changed in exactly the right
order. If the code above causes a site outage - you keep getting
complaints from the browser about redirect loops - then remove the
code and ask again. I'll see if I can find my notes about how to do
initial SSL setup.
You need to change the site url in wp-admin->Settings->General. Except now you need to go in through phpMyAdmin and do it manually in the wp_options table since you are locked out.
You get different cookies depending on http/https so you are getting the https cookie and then being redirected to http that has no cookie because of your Wordpress settings that say what url the site resides at.
It is possible to set the site URL manually in the wp-config.php file.
Add these two lines to your wp-config.php, where "example.com" is the correct location of your site.
define('WP_HOME','https://example.com');
define('WP_SITEURL','https://example.com');
For more refer here
or check in table wp_options column option_name = siteurl check the option_value
I have used this first:
i have
if (
isset($_SERVER["HTTP_X_FORWARDED_PROTO"]) &&
$_SERVER["HTTP_X_FORWARDED_PROTO"] == "https"
) {
$_SERVER["HTTPS"] = "on";
}
still not able to fix and nothing happened.
Then I used
define('WP_HOME','https://example.com');
define('WP_SITEURL','https://example.com');
and I was able to connect to wp with https.
Now I have only minor issues of conflict (mixed https/http content on my page) but most things work.
Thank you!
I went to the cpanel>filemanager and edit the file wpconfig.php
inside php tags i added
if (strpos($_SERVER['HTTP_X_FORWARDED_PROTO'], 'https') !== false) $_SERVER['HTTPS']='on';
Had a similar problem with my wordpress instance.
Using ssh I went in to the directory structure and changed te wordpress root folder permissions to 755 and the .htaccess file to 644.
chmod 755 wordpress/
After that I cloud access my admin panel again.
Go to phpadmin and find wp-options. Change siteurl and home to http. Its work :)

Magento incorrect 404 redirect

Magento is redirecting any 404 errors to the admin login. In the admin settings I have the no route setting set to a CMS page that I confirmed exists.
I have been fighting with this for a week. Cleared cache, reindex, rebuilt url rewrites, etc...
If there is a way to completely bypass magento handling 404 I can do this through htaccess just to get it working.
Ideas?
I also went through and disabled any custom modules I had installed to see if they were affecting it. No luck there.
Checked apache/php logs as well as both exception and system logs generated from Magento. Nothing.
If you had experienced a "4xx Error", it means the error occurred on the user/client side.
If you had experienced a "5xx Error", it means the error occurred on the server side.
404 Not Found
The requested resource could not be found but may be available again
in the future.[2] Subsequent requests by the client are permissible.
I'm not sure, but it sounds like the error is in your controller. You are calling a controller action that doesn't exist.
You has checked the settings?
Admin->System->Config->Web->Default Pages
Default No-route URL should be set to 'cms/index/noRoute'
The drop down beneath that show be your 404 page.
Of course you can put the noRoute to your own module, simply put 'yourmodule/yourindexcontroller/whateveraction' in the box.

Categories