Question: I've got a site set up on an apache server with the desktop site in /public\_html and a mobile site /in public\_html/mob

I'm trying to set up an .htaccess rewriterule to send users to an index.php file in /public\_html if they visit the /mob folder. My current rewrite rule, in the mob subfolder is:

```
RewriteRule ^(/)?$ ../index.php

```

I can load up the same file in the mob subdirectory with:

```
RewriteRule ^(/)?$ index.php

```

However I can't seem to get the site to load the index.php file from the parent directory (public\_html). 

When attempting to load <http://www.domain.com/mob> in a browser I receive:

```
Bad Request

Your browser sent a request that this server could not understand.

```

This same rewriterule worked fine on our development server, but doesn't work in our live environment.

The .htaccess file from the /public\_html/mob folder is as follows:

```
Options +FollowSymLinks
RewriteEngine on

RewriteRule ^(/)?$ ../index.php [L,QSA]

```

When index.php is reached a mobile device detect script decides whether to load the content from the desktop or mobile site.

Answer: 
* Check `DOCUMENT_ROOT` of your `m.domain.com`.

If `DOCUMENT_ROOT` for your `m.domain.com` is `/public_html/mob` then you cannot load `/public_html/index.php` without doing a full redirect (or proxy) to `http://domain.com/index.php`

* Just to clarify any web site cannot access files above its `DOCUMENT_ROOT` folder level.
If your rule's target starts with a `/`, that makes it an absolute URI starting from the *document root*, which I assume would be the public\_html folder:

```
RewriteRule ^(/)?$ /index.php

```