Forum Moderators: phranque
[mywebsite.com...]
The URL should automatically be "changed and redirected to":
[mywebsite.com...]
Basically adding "index.php" in the URL. The number of query string variables can increase or decrease.
It seems that the PHP framework I am using has an issue with using query string variables with segment based urls..
My existing htaccess file is as follows. This basically is to remove index.php from the URLs in rest of the website. don't know how to resolve the above problem..
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /CI-Directory
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /CI-Directory/index.php/$1 [L,QSA]
</IfModule>
The rule you posted does not 'remove index.php' at all. In fact, it *adds* index.php to the client-requested URL-path if that requested URL-path does not resolve to an existing file or directory, and passes control to the script at the resulting filepath.
mod_rewrite works as a client URL request arrives at your server, not as some sort of 'output filter'. Here, it is used to modify the *file* path associated with the client-requested *URL*.
Second, we'll need a much more precise description of the possible variations of the query string. For what query string names do you want to insert "index.php"? For what values of these query parameter names? Conversely, for what names and values should the "index.php" insertion *not* take place?
A thorough description along with several examples will help prevent you getting an incorrect answer and losing your potential helpers' attention by repeated 'No that's not quite right' posts.
Jim
You are right about the adding "index.php" path explanation.
Coming to the problem, The number of query string parameter can be one or more.. Since they would be coming in from a 3rd party system, I would not know "most" of their names as well (besides couple of them)...
With the above scenario, is it possible to achieve my desired outcome?
[webmasterworld.com...]
I hope opening a new topic in my case (when I am looking for an altogether a different solution) do not count as violation of rules of the board. But please do let me know if it is and I will be more careful the next time.
$param = $_GET['param'];
$param2 = $_GET['param2'];
if(($param == 0) && ($param2 == 4))
{
header ("Location: [mywebsite.com...]
}
?>
This would need to be before any html code. However, rereading your post I thought it was just for this these paramaters and not all of the parameters. So this probably won't be useful.