Currenlty I am getting all data from MySQL database using following PHP query string:
ccroipr.php?id=201801161516084475
from this link:
<a href="ccroipr.php?id=201801161516084475">Profile</a>
Now
I want the URL should be ccroipr-201801161516084475
From this link
<a href="ccroipr-201801161516084475">Profile</a>
currenlty, Using following .htaccess rules:
RewriteEngine On
RewriteRule /(.*)/(.*)/$ ccroipr.php?id=$1
It’s accepting this URL:
ccroipr?201801161516084475
Not this one:
ccroipr-201801161516084475
How can I do this using .htaccess?
Update:
Ajax/jQuery Code
$('#register').submit(function( e ) {
e.preventDefault();
var formData = $('form').get(0);
$.ajax({
type : 'POST',
dataType : 'html',
data: new FormData(formData),
url : 'process/ccroipr-cat-p.php',
cache:false,
contentType: false,
processData: false,
beforeSend : function () {
$('#result').html( 'Please wait...' );
$('#registerButton').prop('disabled', true);
},
success : function ( result ) {
$('#registerButton').prop('disabled', false);
$('#result').html( result );
}
});
});
2
Answers
You can use this rule using
-
as delimiter:Maybe you can try this, worked for me.