Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,152,457 members, 7,816,070 topics. Date: Friday, 03 May 2024 at 02:18 AM

Htaccess Is It Htaccess.txt Or What - Webmasters - Nairaland

Nairaland Forum / Science/Technology / Webmasters / Htaccess Is It Htaccess.txt Or What (544 Views)

How To Route Pages To The Index Page And Using Htaccess / How To Add A Custom Robots.txt File In Blogger Blog / The Best Custom Robots.txt & Sitemap Code For Bloggers (2) (3) (4)

(1) (Reply) (Go Down)

Htaccess Is It Htaccess.txt Or What by Joel3(m): 7:48pm On Jul 10, 2015
this suppose to be a cheap question for s person like me. but forgive my ignorance.

I want to assign error request. when page is not found. there is no htacess on the server. I want to put it. it not .php so is it .txt like robots.txt,,?


need help.
Re: Htaccess Is It Htaccess.txt Or What by ps3o(m): 9:44pm On Jul 10, 2015
Joel3:
this suppose to be a cheap question for s person like me. but forgive my ignorance.

I want to assign error request. when page is not found. there is no htacess on the server. I want to put it. it not .php so is it .txt like robots.txt,,?


need help.

create a .Htaccess file with input the below and ensure it is placed in the webroot:

ErrorDocument 404 http://yourdomain.com/pagenotfound.html
Re: Htaccess Is It Htaccess.txt Or What by timotew: 9:48pm On Jul 10, 2015
Whether it PHP or not if you are using Apache server .htaccess file is important.
Firstly, you need to rename the file from htaccess.txt to .htaccess.

inside you ht access file to specify error file ,

Assuming you error files are in the error folder located in the public directory.

For instance your your 401 error file location is : yourwebsite.com/error/401.html.

You can declare it in your .htaccess file as below:

ErrorDocument 401 /error/401.html
ErrorDocument 403 /error/403.html
ErrorDocument 404 /error/404.html
ErrorDocument 500 /error/500.html
Re: Htaccess Is It Htaccess.txt Or What by onyengbu: 12:19am On Jul 11, 2015
Joel3:
this suppose to be a cheap question for s person like me. but forgive my ignorance.

I want to assign error request. when page is not found. there is no htacess on the server. I want to put it. it not .php so is it .txt like robots.txt,,?


need help.
I dont think they answered your question.
The file is neither .php nor .txt. It is a special type of file of its own kind; it is simply .htaccess, you see the dot (.) before htaccess it is crucial!

So just create a new file and save the file as .htaccess NOT htaccess.txt or htaccess.php

(1) (Reply)

Post Your Web Programming Issue (HTML, CSS, Javascript, PHP, MySQL) / [tutorial]webdesignes,developers And Consultants,your Help Is Needed. / Need Help (wapka)

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 27
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.