.htaccess weirdness |
[eluser]SitesByJoe[/eluser]
Ok, this is a little offtopic from CI, but I need smart brains to help me figure this out! I had a website running on procedural PHP from years ago I just updated to run on CI. The old site had .htaccess rewrite rules redirecting things. Now that the site is on CI the rewrites aren't working. I need to change this url: http://www.seaislerealty.com/2010-LERS04-0047 to this url: http://www.seaislerealty.com/index.php/r...RS04/2010/ and I've placed the following on my .htaccess file: RewriteRule ([0-9]{4})-([0-9a-zA-Z]+)-([0-9a-zA-Z]+)$ /index.php/rentals/detail/ $3/$2/$1/ [L] Before, the rewrite rule worked fine. Now I get a "no input file" error. Something's not right but the regex looks fine. Any thoughts? Thanks!
[eluser]pickupman[/eluser]
You may also want to try and use routes. Leave .htaccess to the standard: Code: RewriteEngine On Or try this Code: RewriteEngine On
[eluser]SitesByJoe[/eluser]
Using routes was a good idea. The trouble I'm having now is that rentals/detail/etc/etc/etc can't read data out of the uri segments. Try the link: http://www.seaislerealty.com/2010-LERS04-0047 How do I get the data out of the re-written uri?
[eluser]pickupman[/eluser]
Instead of $this->uri->segment(), use $this->uri->rsegment(). rsegment is for routed uris. In the user guide [url="http://ellislab.com/codeigniter/user-guide/libraries/uri.html"]uri class[/url] provides all the same methods except prepending r for routed uri's.
[eluser]SitesByJoe[/eluser]
Nice one! I should have checked the user guide... |
Welcome Guest, Not a member yet? Register Sign In |