LinuxQuestions.org
Go Job Hunting at the LQ Job Marketplace
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
Search this Thread
Old 07-23-2009, 12:18 PM   #1
Jorkim Kustafin
LQ Newbie
 
Registered: Jul 2009
Posts: 5

Rep: Reputation: 0
Apache htaccess redirect


Hallo, i found an old threed in this forum, when searching for a problem on google.

I want to give a 404 error when the index.html file is requested, i already know how to do this in php, but i cant seem to locate any information about how to do it in htaccess.

I thought about just redirecting index.html to a page that dose not exist, but i would like to do it correctly from the start.
 
Old 07-23-2009, 12:27 PM   #2
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Linux Mint
Posts: 8,496

Rep: Reputation: 883Reputation: 883Reputation: 883Reputation: 883Reputation: 883Reputation: 883Reputation: 883
You could try
Code:
Redirect /index.html /error.html
 
Old 07-23-2009, 12:32 PM   #3
Jorkim Kustafin
LQ Newbie
 
Registered: Jul 2009
Posts: 5

Original Poster
Rep: Reputation: 0
I know, but thats not a "true" 404 is it? Im thinking about using mod_rewrite, to simply make index.html refer to the error document, and then throw out the appropriate headers from within the error document. Similar to whats done in http://brugbart.com/Tutorials/Manipu...ewrite_28.html

My guess is that the correct way to do it would be similar to below?

Code:
RewriteEngine on
RewriteRule ^index.html$ /404.php

Last edited by Jorkim Kustafin; 07-23-2009 at 12:34 PM.
 
  


Reply

Tags
htaccess


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Apache2 .htaccess redirect problem raven Linux - Networking 0 08-06-2007 02:35 AM
.htaccess - whats wrong with this redirect syntax? neocontrol Linux - Server 3 03-16-2007 02:55 PM
Apache redirect with query string (.htaccess) penguintutor Linux - Server 2 09-20-2006 09:45 AM
htaccess 'redirect permanent' failing mikeindo Linux - Networking 0 07-07-2005 01:05 AM
Htaccess with a redirect Diode Linux - Networking 0 10-28-2003 06:23 PM


All times are GMT -5. The time now is 11:01 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration