I'm trying to rewrite a subdomain (NOT REDIRECT) to a $_GET parameter as such:
Desired result:
http://go.example.bz/link/abcde -> http://example.bz/go/link?id=abcde
or
http://go.example.bz/hrm/employee/8 -> http://example.bz/go/hrm/employee?id=8
What's currently working:
http://example.bz/go/link/abcde -> http://example.bz/go/link?id=abcde
and
http://example.bz/go/hrm/employee/8 -> http://example.bz/go/hrm/employee?id=8
with this .htaccess in the root:
RewriteEngine On
RewriteRule ^go/link.php/([^/\.]+)/?$ go/link.php?id=$1 [L]
RewriteRule ^go/hrm/employee.php/([^/\.]+)/?$ go/hrm/employee.php?parameter=$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^(.*)$ $1.php [NC,L]
AddCharset UTF-8 .php
Options -Indexes
and this is how I redirect the subdomain:
<VirtualHost *:80>
Servername go.example.bz DocumentRoot /var/www/go
</VirtualHost>
I do not want to redirect to the -> destination, rather to keep the http://go.example.bz/link/abcde url but have the results of the /link?abcde