Learner
Learner

Reputation: 179

redirect 404 page using htaccess

I want to redirect some page on 404 page. How may I achieve it using htaccess file.

http://wowriters.com/author/admin/feed/
http://wowriters.com/reflective-portfolio/essay-writing-service
http://wowriters.com/reflective-portfolio/dissertation-service
http://wowriters.com/samples/essay-writing-service
http://wowriters.com/samples/uae
http://wowriters.com/worlds-biggest-beverages/coursework-help-service
http://wowriters.com/worlds-biggest-beverages/buy-essays

Above links should be gone on 404 page.

Kindly help me. Thanks in advance.

Upvotes: 1

Views: 216

Answers (2)

unixmiah
unixmiah

Reputation: 3153

ErrorDocument 404 http://wowriters.com/author/admin/feed/
ErrorDocument 404 http://wowriters.com/reflective-portfolio/essay-writing-service
ErrorDocument 404 http://wowriters.com/reflective-portfolio/dissertation-service
ErrorDocument 404 http://wowriters.com/samples/essay-writing-service
ErrorDocument 404 http://wowriters.com/samples/uae
ErrorDocument 404 http://wowriters.com/worlds-biggest-beverages/coursework-help-service
ErrorDocument 404 http://wowriters.com/worlds-biggest-beverages/buy-essays

All the page not found pages will display the links.

Upvotes: 0

anubhava
anubhava

Reputation: 786261

You can use this rule as your topmost rule:

RewriteEngine On

RewriteCond %{REQUEST_URI} /author/admin/feed/ [NC,OR]
RewriteCond %{REQUEST_URI} /reflective-portfolio/(essay-writing|dissertation)-service [NC,OR]
RewriteCond %{REQUEST_URI} /samples/(uae|essay-writing-service) [NC,OR]
RewriteCond %{REQUEST_URI} worlds-biggest-beverages/(buy-essays|coursework-help-service) [NC]
RewriteRule ^ - [L,R=404]

Upvotes: 1

Related Questions