php - Creating a beta version of site on subdomain -
i have website have been working on while. time have been editing live website files on web server development. realized stupid edit live site. "quick" solution copy example.com beta.example.com. edit beta subdomain , when have feature release, copy , replace existing code on example.com site. great.
that great if work. i'm having troubles .htaccess files both domains , url rewriting.
for example.com site, use .htaccess so: (there handful of pages on site)
rewriteengine on rewritecond %{http_host} !^example.com$ [nc] rewriterule ^(.*)$ http://example.com/$1 [r=301] rewritecond %{request_uri} ^/recent rewriterule ^ recent.php [nc,l] rewritecond %{request_uri} ^/about rewriterule ^ about.php [nc,l] rewritecond %{request_uri} ^/category/(.*)/(.*) rewriterule ^ category.php?id=%1&name=%2 [nc,l] rewritecond %{request_uri} ^/category/(.*) rewriterule ^ category.php?id=%1 [nc,l]
the problem beta.example.com site redirects regular example.com. removes beta subdomain.
what proper .htaccess code subdomain sites separate non-subdomains?
you have configure settings beta.example.com on server. setting dns in domain account , if using windows(iis)/linux(apache) server configure same way have configured example.com. if using shared hosting must have cpanel website. create new directory through , point beta.exapmle.com directory.
Comments
Post a Comment