skip to Main Content

I am actually trying to have the URL repointed via HTAccess using the Old Formating of the website:

https://fw1.work/actualites/details.php?ID=3191

to the new Formating. To do so I need to point it to the New URL Formating:

https://fw1.work/actualite.php?id=3191

Actually tried a couple of things online but nothing seems to be working the way I want it…

RewriteCond %{QUERY_STRING} ID=(w+)$
RewriteRule ^actualites/details.php /actualite.php?id=%1 [L]

This is where I am at actually.

2

Answers


  1. make sure rewrite mod enabled,
    then let RewriteRule rgexp match the full url.

        RewriteEngine On
        RewriteCond %{QUERY_STRING} ID=(w+)$
        RewriteRule ^actualites/details.php(.*) /actualite.php?id=%1 [L]
    
    Login or Signup to reply.
  2. You need to write the rules as follows :

    RewriteEngine On
    RewriteBase /
    RewriteCond %{QUERY_STRING} id=(w+)$
    RewriteRule ^actualite.php$ actualites/details.php?ID=%1 [L]
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search