.htaccess 404 redirect to php file - .htaccess

I am currently trying to create a .htaccess file that redirects to a php file if a error 404 occurred.
However, When I choose a php file it just displays the default 404 not found error, but if i change it to html it then works fine and displays my page.
What is wrong with this.
Thanks for your help

Sadly there isn't enough to go on here, but I can give you some questions to help you debug this (too much for a comment otherwise I would have done that):
If you navigate to the php file is it hosted through Apache correctly (when not being used as an ErrorDocument)?
Are there errors in your apache logs from trying to retrieve the php file as an error document?
Is the "default" 404 error the one from Apache or your browser?
If it's Apache's does it say there was an error retrieving the configured error document?
If it's the one from your browser is the php file large enough to not be om nom nommed by the browser (for example: 512 bytes in IE )?

Related

Joomla Server unable to read htaccess file, denying access to be safe

From administrator panel I can't find my plugin css or js file. In console log it's showing :
Failed to load resource: the server responded with a status of 403
(Forbidden)
Now when I access this file from console login the browser showing me following message :
Forbidden
You don't have permission to access /plugins/system/helix3/assets/css/bootstrap.css on this server.
Server unable to read htaccess file, denying access to be safe
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
Can you guys tell me how can I solve this problem. For this error my plugin is not correctly displaying :(
Thank You.
There is little information you give about your problem, but I will try to help you the same. I had a similar problem and with some research I was able to figure out what my problem was.
First check if file exist /plugins/system/helix3/assets/css/bootstrap.css
Second check the access permissions of your /plugins/system/helix3/assets/css/bootstrap.css in joomla and in the folder permission.
Third check if the css you are using does not need anything else to work. Example in mine was a problem with a plugin for firefox.
Sorry for my English but this is not my native language.

creating an error page-404

I've registered my friends website and created it from names.co.uk, the website is (http://www.boillixbaits.co.uk)
I have followed their instructions from their support page as this is my first time trying to create an error page (http://www.names.co.uk/support/hosting/support_centre/linux_hosting/1255-how_to_add_custom_404_error_pages.html)
I followed every step exactly but for some reason this didn't work? Has anyone got any friendly advice or better still what I need to do to make an error-page work when the wrong address is typed in?
Many thanks in advance :)
What you want to do is go to the root of your site (the "public_html" folder, or the "www" folder, in your FTP program. Then you want to make a file called ".htaccess". Not "something.htaccess" or "custom.htaccess", just ".htaccess". In that file, you want to put:
ErrorDocument 404 /404.html
the "/404.html" should be an absolute path to your 404 file. So if your 404 file was in "public_html/files/custom404.html", you would put "/files/custom404.html"

getting 404 error accessing CFM page

I am trying to access a coldfusion file on Server.
The file with xyz.htm extension works fine where as when I convert the same html into coldfusion file, like xyz.cfm , it throws following error:
404 - File or directory not found.
The resource you are looking for might have been removed, had its name changed, or is temporarily unavailable.
May I know what could be the reason?
Assuming CF8 on IIS6?
Could be that you've not correctly run the wsconfig.exe tool which will tie in CF to IIS etc.
Need to know which version of CF, which webserver/OS & versions to help further.
Basically, the webserver needs to know how to parse .cfm requests; without running the webserver connector tool, it won't know which files to use to actually deal with the .cfm files.

Custom 404 error page generates 403

IIS 6.1 - Custom Error pages.
The web site is defined as www.url.com/mysite. Custom error pages have been defined for mysite. 404 and 500.100.
I can redirect to /mysite/500.htm and /mysite/400.htm.
I can set 500.100 to redirect to /global/500.htm and this works.
When I redirect 404 to /global/404.htm I get a 403 access denied error. (I also tried redirecting 404 to /global/500.htm just to make sure it was not file-specific rights.)
Directory browsing is enabled.
The page works if you browse directly to it.
Checked the iis log file for oddities.
Can anyone offer an explanation that might lead me in the right direction?

Joomla : whenever i change URL rewriting and enable htaccess get error

My site was working fine for the last couple of months and suddenly stopped working. and the issue was backend was working fine but the front end does not load at all.
then I contacted server providers they saying they have not done any changes to the server and asking me to contact Joomla support to see any in-depth errors. they even said they cant find any issues from the logs.
Then what I did was I reinstall VirtueMart (mind you this is an e-commerce site). then it started to work again from the front end. but I realize follow on pages aren't working. so what I did was I remove url re-writing and change the .htaccess code to txt.
so the issue I am having now is I can see index.php file in the URL. but whenever I try to change use url rewriting and enable .htaccess I get this error
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, webmaster#domain.au and inform them of the time the error occurred, and anything you might have done that may have caused the error.
Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.
anyone have any ideas?
Suddenly stopped working, without any change from your end ?
Try to step backward and recall anything you did before the issues.
The virtuemart re-installation should not have any relation with the SEF settings and the htaccess.
All these seem to be a combination of different issues.
Have you made any changes on the htaccess file ?
Go in Joomla Global configuration and disable SEF settings. Set URL rewriting to No. Then try to load pages in the front-end.
If you need SEF URLs, follow these instructions about how to enable this feature in Joomla:
http://docs.joomla.org/Enabling_Search_Engine_Friendly_(SEF)_URLs

Resources