I am trying to rewrite the subdomain (NOT REDIRECT) into the $ _ 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 is 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 thatβs how I redirect the subdomain:
<VirtualHost *:80> Servername go.example.bz DocumentRoot /var/www/go </VirtualHost>
I don't want to redirect to destination β to save the http://go.example.bz/link/abcde url, but the results / links? Abcde
source share