Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

I have a simple PHP site that uses the following .htaccess:

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/]+)/([^/]+)/? /index.php?s=$1&p=$2 [L]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/]+)/? /index.php?s=$1 [L]

This work perfectly on the live site, so for the URL www.domain.co.uk/path1/path2, path1 and path2 are passed to PHP as variables.

I'm making some changes to the site, which need to be visible to the client before I upload to their hosting. So I have copied the site to www.mydomain.co.uk/clientsite and modified the .htaccess with rewritebase as follows:

RewriteBase /clientsite

Now when I extend that path to something like /clientsite/path1, I end up with the default page which should be served at /clientsite.

So it would appear something about my htaccess is incorrect - not passing the param parts of the URL through to the PHP.

In short, I want www.mydomain.co.uk/clientsite/ ... to behave as if it were hosted at www.clientsite.co.uk

share|improve this question
Try this site htaccess.madewithlove.be and test this out, it shows the debug output and should help you finding the error in your configuration. –  ETL Mar 9 '14 at 16:58

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.