php - RewriteRule to redirect on different file for subdomain -
i want write rewriterule , rewritecond, whenever sub domain called different file going processed, same url.
i have tried following code, but's not working me
rewritecond %{http_host} !^mydomain\.test\.com$ [nc] rewritecond %{http_host} ^(.*)\.mydomain\.test\.com$ [nc] rewriterule ^$ /app/test/index.php?param=$1 [nc,qsa,l]
i have configured other steps properly. every time calling index file www, not mentioned folder.
you're not capturing $1
in rewriterule
, change code this:
rewritecond %{http_host} ^([^.]+)\.mydomain\.test\.com$ [nc] rewriterule ^((?!app/test/index\.php).*)$ /app/test/index.php?param=$1 [qsa,l,nc]
Comments
Post a Comment