Mercer
Mercer

Reputation: 9996

Redirect Url on Apache Server

I have this url:

https://pouv.com/presentation/vues/restreint/gestionnaire/****

I want to redirect to:

https://pouv.com/bo/

I do this on my .conf:

  ## Rewrite rules
  RewriteEngine On

  RewriteRule https://pouv.com/presentation/vues/restreint/gestionnaire/$ https://pouv.fr/bo/ [R=301,L]

the redirection is not done, why ?

Upvotes: 0

Views: 665

Answers (1)

Amit Verma
Amit Verma

Reputation: 41249

RewriteRule directive uses URL path as the first argument . You need to remove the hostname .

## Rewrite rules
 RewriteEngine On
 RewriteRule ^/presentation/vues/restreint/gestionnaire/.*$ https://pouv.fr/bo/ [R=301,L]

Reference : https://httpd.apache.org/docs/2.4/rewrite/intro.html

Upvotes: 1

Related Questions