Mapping URLs using mod_rewrite in CodeIgniter
I have seen all others questions of everyone on page but i have still done my problem. I uses smarty for my template.
My structure is:
-controllers
- public
- home.php
- about.php
- admin
-views
- templates
- public
- home.tpl
- abount.tpl
So..my link to about page : site_url('public/about.tpl') => can not access when click on that link => i realized that i can access that page with link : http://localhost/mysite/index.php/public/about
I want to remove index.php. In 开发者_如何学编程my .htaccess :
RewriteEngine On
RewriteBase /application
RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ /index.php/$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
Unless you've specifically configured it otherwise, .
can't be part of the URL until after the class and method.
I think you probably just need to change site_url('public/about.tpl')
to site_url('public/about')
(also noticed that the .tlp
is not in your example on localhost)
精彩评论