jeudi 7 septembre 2017

How to rewrite URL and return `404` for original links?

I created my website with some files in htdocs folder, such as: .htaccess, web.php ... In past, I used an old URL structure for my website: old.php?id=12. Then, I have used a new one: new/12, by using this simple .htaccess:

RewriteEngine On
RewriteRule "^new/([0-9]+)/?$" "/old.php?$1"

And now, I do not want any user can access my website with old URL structure. Could you show me: How to rewrite URL and return 404 for original links?

Aucun commentaire:

Enregistrer un commentaire