I need to rewrite url dynamically with title and id. I want to make URL dynamically
http://dev.example.com/beweb/iphone-8.html
Instead of
http://dev.example.com/beweb/newsdetails.php?id=8&title=iphone
When i run the above URL so it is made dyanamically what i need.. but getting error
" Not Found
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
The requested URL /beweb/iphone-8.html was not found on this server."
I have used below code :
RewriteEngine On
RewriteCond %{THE_REQUEST} /beweb/newsdetails.php\?id=([^&\s]+)&title=([^&\s]+) [NC]
RewriteRule ^ /beweb/%2-%1\.html? [NC,R,L,NE]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^%2-([^.]+)\.html$ /beweb/newsdetails.php?id=$1&title=$2 [QSA,L,NC]
Please help me.