We have a new site ready to launch. all development has been done on a separate subdomain (cli.company.com) and we’re using htaccess commands for clean urls, which is all working fine. The HTACCESS code is as follows:
RewriteEngine on
RewriteRule ^page/([^/\.]+)/?$ page.php?page=$1 [L]
RewriteRule ^([^/\.]+)/?/([^/\.]+)/?$ page.php?theme=$1&pg=$2 [L]
RewriteRule ^([^/\.]+)/?$ page.php?theme=$1&pg=$1 [L]
RewriteRule ^([^/\.]+)/?/$ page.php?theme=$1&pg=$1 [L]
So, all good there & works fine on the development site. The problem is we’re now ready to switch to the live domain, and the client has a current site and so we are moving the hosting at the same time. on our server, the domain is setup and all the files there ready to go. the temporary URL that cPanel gives us looks something like this: http://00.00.000.000/~cli/_clientsite.com/.
The homepage of the site comes up just fine in the final testing as it doesn’t rely on the url rewrite, but the interior pages are giving a 404 error, which i think is because of the rewrite rule not kicking in properly.
I only need this to work for the testing as we can’t afford this to go live and not work. Is there a way around this?
Before your RewriteCond lines, add a RewriteBase line like so: