Welcome Guest, Not a member yet? Register   Sign In
Codeigniter mod re-write (and not just the index.php thing)
#1

[eluser]Unknown[/eluser]
I am struggling on this:

I want it so when a user types in www.website.com/videos they actually get the 'website.com/home/main' page.

I have used this:

RewriteRule ^videos$ /index.php/home/main [L]

...but it does't work, it just shows the 'website.com' page and not even home/main.

If I use:

RewriteRule ^videos$ http://www.website.com/index.php/home/main [L]

..then it does work but the address bar changes to http://www.website.com/index.php/home/main which isn't good for SEO.

Please help as this is crazy.

I also have:

RewriteRule ^(.*)$ /index.php?$1 [L]

...but that is underneath the '/videos' one and does work for that purpose.
#2

[eluser]Aken[/eluser]
Use .htaccess to remove the index.php, then use Codeigniter's Routes feature to do the rest. http://ellislab.com/codeigniter/user-gui...uting.html
#3

[eluser]Unknown[/eluser]
Thanks for the reply Aken.

So are you saying that I should remove all the other .htaccess stuff I have (re-writing /videos etc.), and ONLY use this in .htaccess:

RewriteRule ^(.*)$ /index.php?$1 [L]

..and then use the PHP code in the link you provided to do the /videos re-writing / re-mapping. Is that what you are saying?
#4

[eluser]Aken[/eluser]
Correct.




Theme © iAndrew 2016 - Forum software by © MyBB