PHWinfo banniere

ACCUEIL ANNUAIRE ARTICLES COMPARATIF HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Go Back   PHWinfo > Forums Hébergement > Forum Serveur - Sécurité et techniques > alt.apache.configuration > A Mod_rewrite RewriteRule to return a 404
FAQ Members List Search Today's Posts Mark Forums Read
alt.apache.configuration Apache web server configuration issues.

A Mod_rewrite RewriteRule to return a 404

Reply
 
Thread Tools
Old 09/23/08, 14:03   #1
Dave Mabe
Aucun Avatar
 
Posts: n/a
Hébergeur:
Default A Mod_rewrite RewriteRule to return a 404

I've got a URL structure created using mod_rewrite. Now, for a few of
the rules in there I'd like to have 404's returned.

How do I change for example this line to return a 404 when it's
matched?

RewriteRule ^rss/?$ /rss.html [QSA,L]
  Reply With Quote
Old 09/23/08, 19:57   #2
Tim Greer
Aucun Avatar
 
Posts: n/a
Hébergeur:
Default Re: A Mod_rewrite RewriteRule to return a 404

Dave Mabe wrote:

> I've got a URL structure created using mod_rewrite. Now, for a few of
> the rules in there I'd like to have 404's returned.
>
> How do I change for example this line to return a 404 when it's
> matched?
>
> RewriteRule ^rss/?$ /rss.html [QSA,L]


I don't think I understand your question? Do you want to output a 404
error instead of the other page being output, as you have it above?
How about instead of the rewrite, you just remove the rss directory (or
rename it) and not have a redirect/rewrite rule, and it'll naturally
produce a 404 error? Or, are you trying to keep the directory, but
just give a 404 based on the URL or domain they are accessing the
directory from, to force visitors to view it via one specific URL?
--
Tim Greer, CEO/Founder/CTO, BurlyHost.com, Inc.
Shared Hosting, Reseller Hosting, Dedicated & Semi-Dedicated servers
and Custom Hosting. 24/7 support, 30 day guarantee, secure servers.
Industry's most experienced staff! -- Web Hosting With Muscle!
  Reply With Quote
Reply


Thread Tools

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


All times are GMT +1. The time now is 21:47.


Powered by vBulletin® ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.3.0
PHWinfo is a website Education Without Frontiers
Ad Management by RedTyger
All rights reserved
Page generated in 0.12657 seconds with 8 queries