everyone..
I have problem in my URL. I rewrite my URL like this friendly url.
http://www.lankainstitute.com/1289/Mahesh Jayarathna HTTP/1./?1
But end of my url this string “HTTP/1./?1” has added..
can anybody tell me why is this???
this is from my .htaccess file
RewriteEngine On
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /profiles/tutors/index.php\?tutorCode=([0-9]+)&tutorName=([^&]+)&?([^\ ]+)
RewriteRule ^profiles/tutors/index\.php /%1/%2/?%3 [R=301,L,NE]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([0-9]+)/(.+)/$ /profiles/tutors/index.php?tutorCode=$1&tutorName=$2 [L,QSA]
any comments are greatly appreciated..
thank you.
You need to tweak your regular expression in the
%{THE_REQUEST}match. When there isn’t anything after thetutorName=somethingquery string parameter, the space before theHTTP/1.1in the request never gets matched so it ends up as part of the([^&]+)grouping. Try tweaking the regex to look like this (and note in the rule, the backreference needs to be changed to%4):