开发者

How to redirect requested uri that don't exists to 404 page with Apache?

开发者 https://www.devze.com 2022-12-16 01:00 出处:网络
I\'ve now used rewrite to achieve part of my goal: 开发者_运维技巧 rewriteengine on rewritebase /

I've now used rewrite to achieve part of my goal:

开发者_运维技巧
rewriteengine on
rewritebase /
rewriterule ^([a-zA-Z][a-zA-Z0-9]*)$ resume.php?user=$1

How to add the 404 part?


You could just use ErrorDocument rather than mod_rewrite:

ErrorDocument 404 /yourUrl.html


You can use the Apache ErrorDocument directive to direct 404s to a particular URI.

For example:

ErrorDocument 404 /resume.php
0

精彩评论

暂无评论...
验证码 换一张
取 消