Welcome to WebmasterWorld Guest from 220.127.116.11
RewriteRule ^([^.]+)/?$ /search.php?l=$1 [L]
But now the problem I face is that the above rule breaks when there is a dot(.) in the url.
I tried to change the rule to
RewriteRule ^(.+)/?$ /search.php?l=$1 [L]
But is not working and gave me an internal server error.
So can any one help me with the rule so that it also includes url with a dot (.) in them.
Here dot (.) matches only the literal (.) character and is not matching Ďany character expect the new line characterí.
I want all the characters after the domain name to be passed to the query string (even special characters like $,#,^ etc) so I cannot use the rule
RewriteRule ^([A-Z0-9\.\-]+)/?$ /search.php?l=$1 [NC,L]
But anyways thanks for replying.
So [^.]+ means, "one or more characters not equal to a dot/period/full stop."
However, if you want to "allow" dots in the requested URL-path, and you change the rule pattern to this:
RewriteRule ^(.*)$ search.php?l=$1 [L]
This problem can be corrected by adding a RewriteCond -- in this case:
RewriteCond $1 !^search\.php$
RewriteRule (.*) search.php?l=$1 [L]