I have a URL in the form of
motors.com/project?id=1&title=british-car-auctions
And wish to change it to
motors.com/project/1/british-car-auctions
I have used solutions from URL rewriting with PHP and Rewritting URL by htaccess with no luck. As for the title
section of the URL, I am calling this exact text with dashes from the database, which shouldn't be an issue. Any possible solutions to this problem?
# mode_rewrite starts here
RewriteEngine on
# does apply existing directories, meaning that if the foilder exists
RewriteCond %{REQUESTED_FILENAME} !-d
# check for file in directory with .hmtl extension
RewriteCond %{REQUEST_FILENAME}\.php -f
# here we actually show the page that has the .html extension
RewriteRule ^(.*)$ $1.php [NC,L]
#-----------------------------------------------------
RewriteCond %{REQUESTED_FILENAME} !-d
# check for file in directory with .hmtl extension
RewriteCond %{REQUEST_FILENAME}\.html -f
# here we actually show the page that has the .html extension
RewriteRule ^(.*)$ $1.html [NC,L]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^news/([0-9]+)(/?)$/([0-9a-zA-Z\s_]+) news/article.php?id=$1&title=$2 [NC,L]