I have search for this issue on Stacks but can't find the solution, so maybe can someone have an solution on the issue below.
I have build an (php)system on a subdomain, now i need to drop it on the server side of the customer, when i've done this, the bindings paths doesnt work anymore.
I see the page but he doesnt load the informatie.
.htaccess
Options +FollowSymlinks
RewriteEngine On
RewriteCond %{HTTP_HOST} !^*******\.******\.nl/mtsadmin$ [NC]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^([a-z0-9]*)$ $1.php
RewriteRule ^admin/users/edit/([0-9]+) admin/users.php?edit=$1 [NC]
RewriteRule ^/formulier /form.php?id=$1 [NC]
I have tried it with / before 'admin' and without a '^', but that's not the solution.
Below my page script.
if(isset($_GET['edit'])) {
if(trim($_GET['edit']) != '') {
$edit = $dbh->prepare('SELECT * FROM users WHERE id = :id');
$editvar = trim($_GET['edit']);
$edit->bindParam(':id', $editvar, PDO::PARAM_INT);
The path of the .htaccess public_html/subdomain/.htaccess
There is a map form and that works.
But in the map public_html/subdomain/admin/users.php
This path doesnt work in .htaccess. It works on my own server but doesnt work on the server of my client.
I like to hear from you!
RewriteRule ^admin/users/edit/([0-9]+) admin/users.php?edit=$1 [NC]
Using ^ mark in rule says that it is very beginning of string to be rewrited. As you've posted in comments. /admin/users.php WILL be redirected, because it is starting from admin/users as in rule. But /mtsadmin/admin/users does not start with "admin" but rather "mtsadmin" string, and it is not caught by rewrite rule.
Change the mentioned line, to reflect correct path on production server.