I want to change some .php files located in www.mywebsite.com/en/. For example:

iscrizione.php --Rewrite to--> subscription.php
programma.php --Rewrite to--> program.php

How can I do that with some RewriteRule(s)?

1 Answers

Nebojsa Nebojsa On

You can do it this way

RewriteEngine On

RewriteCond %{REQUEST_URI} /iscrizione.php
RewriteRule ^(.*)$ https://www.website.com/en/subscription.php [R=301,L]

RewriteCond %{REQUEST_URI} /programma.php
RewriteRule ^(.*)$ https://www.website.com/en/program.php[R=301,L]


Redirect 301 /en/iscrizione.php https://www.mywebsite.com/en/subscription.php
Redirect 301 /en/programma.php https://www.mywebsite.com/en/program.php