Custom 404 error page - windows

I am trying to create a custom 404 error page. The instructions that I found say to create a .htaccess empty text document when I do that Windows tells me to put a file name on it. Can someone tell what I need to do or point me to a tutorial for making custom 404 error pages?

It seems like you're just trying to make the page itself (according to the commentary on the question). To create the page just make a file of any name .html or whatever format you wish to use (.php for php for example) and write it up using your language of choice. Once you create the 404 page you need to specify it's location, assuming you're uploading this to a site of yours. This should be editable in a control panel like CPanel for example. If not, you'll need to edit your apache config to specify it's location or make and upload an .htaccess file to specify it's location.

The problem is that Windows Explorer doesn't let you create file with name .htaccess. Instead of creating the file with Windows Explorer, open a Notepad and save the file with name .htaccess. Don't forget to change "Save as type" to "All Files (*.*)", otherwise it will add .txt extension to it.

Assuming you are using Apache and .htaccess is not activated you use
# this is in .htaccess in the root directory of the webspace
ErrorDocument 404 /url/to/error/page.html

Related

404 error page when trying to access website (hostgator)

I have recently finished building my website and since I didn't know how to put it online I decided to follow this tutorial: https://youtu.be/tq7dqdHCc7U
Everything worked fine until I tried to upload my .html files. I copied them into a www folder I created, but when I try to access the site with myIP/~username, I get a 404 error page. What am I doing wrong?
I guess you have put html file in wrong directory. Please put a sample index.html in root directory and in public_html folder. and try to access with domain name. it should work
A 404 error means that a valid page wasn't found. The only html file that apache know to render automatically is an index.html file. That's the default for the root url (in your case: yourIP/~username). So to fix the problem, you can either change what apache looks for in a index page in your httpd.conf, rename one of your files to index.html, or just append the name of a file that does exist to the end of your URL: yourIP/~username/myPage.html

How to enable module rewrite in Apache configuration

I'm trying to copy website made in Magento in my localhost and finished another steps:
copied whole website via flash drive,
import database from server,
change parameters for database in local.xml (post root for user and
empty field for password),
clear cache in Magento var folder,
change base_url value in database
When I try to open it in browser, Homepage looks ok, but any link in page give me Error 404 - Object not found. I can't access to admin panel. Anything what I type URL after localhost/nameOfMyProject, I get Error 404.
I have another Magento project in my localhost and they work correctly, but that I installed from fresh Magento installation and then add new themes for that.
Here is different situation. I need to add whole existing project from server in localhost. I can't add this website on same way, because developer who made it changed files into core section. Project is too big it's not possible at the moment to change that, so any way is to download whole project in localhost.
Does anyone has some suggestion what to do?
If you are using XAMPP or WAMP as your web server, you may face a common problem that is the rewrite module (mod_rewrite) does not work properly. It is because the rewrite module is not enabled by default in Apache’s configuration settings. But you can enable it manually by following some simple steps:
1- Open apache’s configuration file using your favorite text editor. The configuration file is generally located at:
{apache_dir}/conf/httpd.conf
If you are using XAMPP or WAMP package then you will find the file at:
{xampp_dir}/apache/conf/httpd.conf
{wamp_dir}/apache/conf/httpd.conf
2- Search for the following string:#LoadModule rewrite_module modules/mod_rewrite.so and uncomment it (remove the ‘#’ sign).
3- Now search for another string AllowOverride None and replace it by AllowOverride All
4- Finally save the changes, close your text editor and restart your apache server.

Joomla: pages not found after copying site to another directory

I have copied a live joomla site. The original is found at [this][1] website. The copied one in found [here][2]. But all links (e.g. in the left navigation menu) result in 404 errors. The administrator backend is accessible and i can create new menu items in the copied one but they all result in 404 errors.
I did adjust the configuration.php file so var $tmp_path var $log_path point the right paths. i updated var $live_site = 'http://hosting01.hestronic.nl/~ijskoud2
The live_site was empty in the original configuration.php file.
Do i still need to run an update or something?
Thank you
PS joomla 1.5.25
Turn off search engine friendly url feature in System -> global configurations.
If you really want to enable SEF URL then you need to set your rewrite base according to your site dir in the server.
For $live_site variable, no need to modify it and keep it empty.
I ran into a similar issue where all of my links were doubling up. Fixed by prefixing http:// to $live_site
You don't need to do anything to $live_site, just leave it blank. The tmp and log paths are the only thing you need to touch. If you have SEF URLs turned on, you will also need to change the rewrite base from / to what ever the subdirectory is.
I disagree with my friend #Brent. Go to your DB to the menu table (by default its called jos_menu) and look for the "path" column. you probably need to manually fix the paths of all your menus to point to the new folder.
Check if the .htaccess file exists in your new folder. if not exists remove the sef url configuration from admin side.

CodeIgniter uploads directory

I'm trying to achieve:
I am using CodeIgniter.
I am trying to access http://localhost/mywebsite/uploads/. The directory exists, and via a 3rd party upload script, I can successfully write to that directory. However, when going straight to the URL (or referencing its files in an src attribute), it gives me a 404 error.
I thought the best way to do this was to:
Make sure my $config['base_url'] was set to http://localhost/mywebsite/.
(For an unknown reason, I can access /mywebsite/js/ but not /mywebsite/uploads/.)
I read the documentation and it said to:
Create a folder at the root of your CodeIgniter installation called
uploads and set its file permissions to 777.
That works to upload to, but it doesn't work to access from!
I did it, I expected to see:
Either a directory listing or permission denied page. I even tried going straight to a file, like http://localhost/mywebsite/uploads/myfile.jpg.
Instead, I saw:
404 Page Not Found
The page you requested was not found.
What am I doing wrong?
Please check your .htaccess file,
there shouldn't be any rule to restrict the access to the uploads folder.
("uploads" should not appear within this rule: RewriteRule ^(css|js|ckeditor) - [L])

codeigniter : unable to access image inside view folder

am using codeigniter 2.
when i use the below i cant get the image.
application/views/admin/images/image.png
folder structure is correct.but the image is not coming there.from view
source option i got the following
403 Forbidden
Forbidden
You don’t have permission to access /application/views/admin/images/image.png
on this server.
am on local server wamp.
if i put the image on root i can get it
but i was uing similar folder structures with codeigniter 1.7.3 those were working for me
i dont know why its not with ci2 or i mde any mistake…..
Only .php view files are supposed to exist within the /application/views directory. You should store images in a directory like /images or /assets in the web root.
there may be .htaccess file in your root what deny write.
Rename .htaccess and try again.
if it works, you may edit .htaccess

Resources