I need to format my URL using .htaccess file but my script not working

This is my URL

My htaccess script

RewriteEngine On
RewriteRule ^details/([^/]*)/([^/]*).html$ /details.php?id=$1&post=$2 [L] 

I need to get my URL to

how can i change my url to above format. Please help me.

Source: .htaccess

1 Comment

  1. Digin Dominic

    You need another rule to redirect old url to pretty URL:

    Options -MultiViews
    RewriteEngine On
    RewriteBase /

    RewriteCond %{THE_REQUEST} /details.php?id=([^s&]+)&post=([^s&]+)s [NC]
    RewriteRule ^ /detail/%1/%2? [R=302,L,NE]

    RewriteRule ^details/([^/]+)/([^.]+).html$ details.php?id=$1&post=$2 [L,QSA,NC]


Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.