Welcome Guest, Not a member yet? Register   Sign In
.htaccess redirect from old links to new links
#1

[eluser]diridam[/eluser]
Hello,
i have ported my site to ci and i want to 301 redirect all the old links to the new URI format of CI
for example when someone uses www.site.com/file.php?site=3344 i want to redirect him to www.site.com/controller/function/3344

i have searched all over for a .htaccess rule to help me do this but with no success.

thanks for help
#2

[eluser]diridam[/eluser]
anyone can help me with this ?

thanks
#3

[eluser]n0xie[/eluser]
Take a look here
#4

[eluser]diridam[/eluser]
[quote author="n0xie" date="1266862887"]Take a look here[/quote]

Thanks for the pointing, i ended up having the same errors as the guy in that thread.

i want to rewrite vote.php?id=number in site.com/ci/controller/function/id

i underline that i used the tweak to remove index.php from the codeigniter's default uri scheme. (of course through mod_rewrite)

i don't know why, but when i access site.com/ci/vote.php?id=number it gives me a 404 error page instead of redirecting me to the site.com/ci/controller/function/id.... basically CI looks for vote.php and it doesn't find it ....
i added this rule RewriteRule ^vote.php?id=(.*)$ index.php/vote/take/$1 [L,R=301] above all other rules in my htaccess, even above the rewritebase.. which in my case is /ci/


thanks !
#5

[eluser]n0xie[/eluser]
I spend some time investigating the problem. Take a look at my explanation in the other thread why my first solution wasn't working.




Theme © iAndrew 2016 - Forum software by © MyBB