.htaccess - htaccess: one controller under root control all pages under all subdomains without redirect -
i need htaccess file under root folder.
please see photo url: site structure (sorry, can not upload image here)
i have lots of cities folder subdomains, not wish every subdomain needs separated admin, wish can control them under same admin page.
so if want :
ny.example.com/news.php ==> example.com/controller/ny/news ( or example.com/controller.php?city=ny§ion=news)
how can write htaccess file please ?
in root htaccess, add these rules :
rewriteengine on rewritebase / rewritecond %{http_host} ^([^.]+)\.example\.com$ [nc] rewriterule ^ controller/%1/news/ [r,l] rewritecond %{request_filename} !-d rewriterule ^controller/([^/]+)/([^/]+)/?$ controller.php?city=$1§ion=$2 [nc,l]
Comments
Post a Comment