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

Popular posts from this blog

c# - How Configure Devart dotConnect for SQLite Code First? -

java - Copying object fields -

c++ - Clear the memory after returning a vector in a function -