Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

Coding Forum


You are currently viewing our Coding Forum as a guest. Please register to participate.
Login



Reply
Put RewriteRule (.*) in twice
Old 03-28-2007, 08:10 PM Put RewriteRule (.*) in twice
Skilled Talker

Posts: 99
Trades: 0
I want to specify an error page for error 404 and 403, so i want RewriteRule (.*) /errorpages/403.html for my 403 error and RewriteRule (.*) /errorpages/404.html for my 404 error. But every time I put more than one rewrite rule it gives me an error and my webpage goes down.

how can i get around that??
Arez20469 is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 03-29-2007, 03:28 AM Re: Put RewriteRule (.*) in twice
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,517
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
you don't use rewrite rules for custom error documents.

there you have two identical rules sending everything to two pages,


see another post of yours on error docs.
http://www.webmaster-talk.com/coding...ther-page.html
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 03-31-2007, 08:57 PM Re: Put RewriteRule (.*) in twice
Skilled Talker

Posts: 99
Trades: 0
"By creating error files
You can simply create error pages and name them as follows:
error400.html
error403.html
error404.html
error500.html

Please place these files in the home directory of your domain.

By adding this piece of code in the .htaccess file
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.*) /errordocument.html"

if I don't use rewriterule, then when someone visits my page, it goes to the location of the customized error page instead of just displaying the information.
Arez20469 is offline
Reply With Quote
View Public Profile
 
Old 04-01-2007, 05:05 AM Re: Put RewriteRule (.*) in twice
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,517
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
I think you have something totally mixed up somewhere, you obviously have read http://www.phpbb.com/community/viewt...?f=17&t=490712 and not understood it.

Using this code
Code:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.*) /errordocument.html"
Would create rules that if a directory (-d) or a file (-f) does NOT (!) exist the requesting user agent would be send to a file called errordocument.html

What you need is the ErrorDocument lines as I pointed out in your other post

http://www.webmaster-talk.com/coding...ther-page.html
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 04-01-2007, 03:12 PM Re: Put RewriteRule (.*) in twice
Skilled Talker

Posts: 99
Trades: 0
ErrorDocument 403 http://www.mypage.com/errorpages/banned.html
ErrorDocument 404 /errorpages/file.html
CheckSpelling off
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.*) /errorpages/file.html

that gives 'The page isn't redirecting properly

Firefox has detected that the server is redirecting the request for this address in a way that will never complete.'

when I use ErrorDocument 403 /errorpages/banned.html, it doesn't do anything and comes up with the default error message...
Arez20469 is offline
Reply With Quote
View Public Profile
 
Old 04-02-2007, 05:55 AM Re: Put RewriteRule (.*) in twice
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,517
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
test one line at a time as .htaccess rules can often conflict and create a problem.

Have you any other rules defined earlier in the document ?
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 04-02-2007, 10:52 AM Re: Put RewriteRule (.*) in twice
ibbo's Avatar
Super Spam Talker

Posts: 880
Location: Leeds UK
Trades: 0
Mine reads as follows, nothing overly complicated in that.

ErrorDocument 400 /errors/?mode=badrequest
ErrorDocument 401 /errors/?mode=authreqd
ErrorDocument 403 /errors/?mode=forbid
ErrorDocument 404 /errors/?mode=notfound
ErrorDocument 500 /errors/?mode=serverr

Ibbo
__________________

Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE

Please login or register to view this content. Registration is FREE

Linux user #349545 :
(GNU/Linux)iD8DBQBAzWjX+MZAIjBWXGURAmflAKCntuBbuKCWenpm XoA7LNydllVQOwCf
ibbo is offline
Reply With Quote
View Public Profile Visit ibbo's homepage!
 
Old 04-05-2007, 12:40 AM Re: Put RewriteRule (.*) in twice
Skilled Talker

Posts: 99
Trades: 0
ErrorDocument 403 /errorpages/banned.html
ErrorDocument 404 /errorpages/file.html
CheckSpelling off
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule (.*) /errorpages/file.html

deny from 67.153.
deny from 67.176.
deny from all

thats all i have in my .htaccess, and it doesn't work. that is why I am really frustrated. I am using 1and1, so it must be my host. the 404 responds because of the rewrite rule, but the 403 acts like it doesn't exist when I ban myself.
Arez20469 is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Put RewriteRule (.*) in twice
 

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 On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.27004 seconds with 12 queries