Drew
Drew

Reputation: 6862

URL Rewriting with .htaccess and subdomain issue

I have the following Rewrite Rule:

RewriteCond ${rewrite_map:$1|NOT_FOUND} !NOT_FOUND
RewriteRule ^([a-zA-Z0-9_-]+)/?$ index.php?shop_id=${rewrite_map:$1} [NC,L,QSA]

So the URL for that looks like: http://www.domain.com/company-name/

Well I am developing an iPad version so I am redirecting to: http://m.domain.com/ which works fine but when I go to the URL http://m.domain.com/company-name/ I get a Page Not found error. The m subdomain is pulling from my /ipad directory. If I go to http://www.domain.com/ipad/company-name/ THAT works as well. I just need it to work on my mobile subdomain as well.

Does anyone know what I need to add to make this work?

Thank you!

Upvotes: 1

Views: 571

Answers (1)

Drew
Drew

Reputation: 6862

For anyone interested, I figured it out by adding the following to my htaccess file:

RewriteCond %{HTTP_HOST} ^m\.domain\.com$
RewriteRule ^ http://domain.com/ipad%{REQUEST_URI} [L,P]

Upvotes: 1

Related Questions