I am Required to write rule for redirection in my website.and i am using codeigniter.so it will use index.php for all pages.
So my first rule i used is
RewriteRule ^(.*)$ /index.php/$1 [L].
now i want to add some thing more which are follows.
My requirement first:
input – example.com/index.php/search/query
url to be redirected – example.com/search?q=query
And,
input – example.com/index.php/search/query&c=abc&s=xyz&p=1
url to be redirected – example.com/search?q=query&c=abc&s=xyz&p=1
Thats it.
Can Anyone crack code for this.? Please…
Thanks in Advance.
Edited: Tell some reference website to know more about rules and condition syntax to write .htaccess file.
In you html code you must write like this:
and in the htaccess file adapt the following:
using () you mark the data that you need to extract and work with it;
using $x, where x=1,2,3, …
$x is the value
the more () you have, the more $x you have
with: RewriteRule ^(member)-([0-9-]+)$ index.php?action=member&id=$2 [NC,L]
(member) is $1 and ([0-9]+) is $2
do you understand?