Question

Question is simple I want to rewrite http://www.mydomain.com/test123.com like http://www.mydomain.com/details.php?domain=test123.com

RewriteRule ^([^/]*)$ /details.php?domain=$1 [L]

Thanks.

Was it helpful?

Solution

For your rewrite URL. You can use following .htaccess

RewriteEngine On
RewriteCond %{REQUEST_URI} !^/(index.php)?$ 
RewriteCond %{REQUEST_URI} !^/details.php$ 
RewriteRule ^(.*)$ /details.php?domain=$1 [QSA,L]

It will rewrite http://www.mydomain.com/test123.com to http://www.mydomain.com/details.php?domain=test123.com

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top