.htaccess mod_rewrite for dynamic url which has domain names

I want to convert this url ex:( example.com/link.php?url=facebook.com ) to ( example.com/facebook.com.php )

How can I do this using .htaccess. Or Is there any other process which will make this job easier ?

I tried by adding the script to .htaccess file

Options +FollowSymLinks RewriteEngine on RewriteRule url-(.*)\.htm$ link.php?url=$1

But its converting the url by adding "url-" ( example.com/url-facebook.com.php )

I want to remove "url-" and want to make it look like ( example.com/facebook.com.php )

-------------Problems Reply------------

RewriteEngine On
RewriteCond %{THE_REQUEST} ^GET.*link\.php\?url\= [NC]
RewriteCond %{REQUEST_URI} !/system/.* [NC]
RewriteRule (.*?)link\.php\?url\=/*(.*) /$1$2 [R=301,NE,L]

Not too sure how well the above will work it is an edit of something I used to use to remove index.php from a url

Category:php Views:36 Time:2018-10-10

Related post

Copyright (C) dskims.com, All Rights Reserved.

processed in 0.164 (s). 11 q(s)