I need to adopt the following scheme:
-
If the url contains any file/script reference, leave that without rewriting
example.com/index.php ---> leave without rewriting url -
If the url doesn’t contains any references, something similar to:
example.com/some-thing-is-hereRe-write this to:
example.com?search.php?q=some-thing-is-here
I’ve found the solution for (1), but they all fail with (2). I am a newbie in htaccess, so need suggestions of how to do it, or a common general method to do it.
The following should do what you ask. In addition to excluding files, it also excludes directories.
This article has some good information if you want to learn more about clean URLs.
Below are a few more resources if you want to learn more about .htaccess. Usage of this file is fairly complex. Once you know what it is capable of, I recommend you search on Google for the features you need, when you need them. There are a lot of things it does that you may never need.