tags:

views:

21

answers:

2

Hi there,

I need an htaccess 301 redirect for dynamic urls going from this url:

http://www.example.com/index.php/?content/page1

to

http://www.example.com/content/page1

My current htaccess rule is:

RewriteBase /    
RewriteCond %{HTTP_HOST} !="" 
RewriteRule ^index.php(/.*)$ http://%{HTTP_HOST}$1 [R=301]

the problem is I get urls like this:

http://www.example.com/?content/page1

How can I remove that question mark (?) from the url. Also this is for about 20 different urls in this pattern. I would like the rule to work for all my urls needing to be 301 in this pattern.

A: 

another version with same result

RewriteCond %{THE_REQUEST} ^[A-Z]+\ /index.php[/?\ ]

RewriteRule ^index.php(/(.*))?$ /$2 [L,R=301]

but still cant remove index.php/? and only remove index.php

anyone can help me too?

kewell
I'll gladly pay someone for the solution. 25 bucks to your paypal if you provide me a solution.
SeanSpeedy
A: 

End the target in a ?.

RewriteRule ^index.php(/.*)$ http://%{HTTP_HOST}$1? [R=301]
Ignacio Vazquez-Abrams
thanks for reply Ignacio. That one makes my original url redirect to homepage instead of the new url. To answer your question, I don't want any ? in the url. We are using Codeigniter framework if that is any help.
SeanSpeedy