I work with the MVC PHP user infrastructure, and the index page (acting as a router) receives the GET "do" variable, which contains the path to be routed. If this variable is not set, the default Auth controller is the login method.
require_once('config.php');
$controllerAction = isset($_GET['do'])?$_GET['do']:"auth/login";
require_once('core/main.php');
Then the index page (source code above) transfers this $ controllerAction to the main.php file, which automatically loads the main controller and then loads the requested controller.
Thus, the URIs in this structure are of the form mysite.com/?do=controller/method/variable, and I need it to be in the form mysite.com/controller/method/variable.
Here is the .htaccess file I tried to use, it just didn't work (I have other htaccess files running on the same server, so this is not an Apache problem): (
RewriteEngine On
RewriteRule ^([^/]*)$ /?do=$1 [L]
Someone suggested I do this using PHP, but I'm not sure how to do this.
Edit: The error is that I get the message "This page cannot be displayed", 404 errors when I try to access the mysite.com/controller/method links directly, and not the default mysite.com?do=controller/ method
Further editing
(note that other virtual hosts work fine on my localhost):
(XAMPP) Apache shared hosting information:
<VirtualHost *:80>
DocumentRoot "D:\sites\mysite.com\root\wwwroot"
ServerName mysite.com
ServerAlias mysite.com
<Directory "D:\sites\mysite.com\root\wwwroot">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Order allow,deny
Allow from all
</Directory>
</VirtualHost>
File Structure (Windows):
D:\
--sites