This is my htaccess code:
RewriteEngine On
RewriteBase /visio
# Turn on the rewriting engine
# RewriteRule [region]?.html$ index.php/login/getProvinces [L]
# RewriteRule post_([0-9]+).html$ index.php?admin/index/url=$1
RewriteRule ^([^.]+)$ index.php/admin/index/$1
When iam try to load this url :
http://myserver.net/visio/test
I got the 404 not found error.In this url visio is the directory of my site in the server.When iam loading this url i want to go to the admin controller’s index().
How can i do this?
If there is any mistake in my code?
This is mmy index() code:
function index(){
if(isset($_GET['url'])){
$newkey = $_GET['url'];
$data['result'] = $newkey;
$this->load->view('index',$data);
}else{
redirect('admin/index_login');
}
}
I want to get the url value in index() also.
But when iam changing the url like this:
http://myserver.net/visio/?test
Then it will goes to the index().So what is the problem in code?
^([^.]+)$is a regular expression that matches “everything that is not any character”. In other words, it will only match “nothing, once or more” (the dot symbol). If you meant to match actual dots, add a backslash in front of it.