Question: I am working with codeigniter. My current htaccess file works fine on my local environment - but when I load it onto the server I am using I get a 404 page not found error. 

I am a complete newbie with htaccess - so you might have to spell it out for me. One thing that might affect this - I have several sites on the same domain right now - so the current site is in a sub-directory called "ripped2"

Here is my htaccess:

```html
Options +FollowSymLinks 
Options -Indexes 
DirectoryIndex index.php 
RewriteEngine on 
RewriteCond $1 !^(index\.php|resources|images|css|js|robots\.txt|favicon\.ico) 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule ^(.*)$ index.php?/$1 [L,QSA]
```

Answer: 
`Server.MapPath` takes virtual path, ex: `~/Folder/file.ext`. So you can't pass in a physical path like `D:\Folder\PDF` to it.

The syntax for accessing a remote file system is different, you need a UNC file path. In your config file, myPath should be like `\\servername\d$\Folder\PDF`, and you won't need any calls to `Server.MapPath` and the user your site process is running as should be an admin on the server you're accessing.

Or you can specifically share out the folder and give permissions to the account your web server runs as, then you don't need admin privileges (this is more secure). Then the UNC path is like `\\servername\sharename`.
Here is a reference: [Server.MapPath("."), Server.MapPath("~"), Server.MapPath(@"\"), Server.MapPath("/"). What is the difference?](https://stackoverflow.com/questions/275781/server-mappath-server-mappath-server-mappath-server-mappath)

Server.MapPath specifies the relative or virtual path to map to a physical directory.

```
Server.MapPath(".")1 returns the current physical directory of the file (e.g. aspx) being executed
Server.MapPath("..") returns the parent directory
Server.MapPath("~") returns the physical path to the root of the application
Server.MapPath("/") returns the physical path to the root of the domain name (is not necessarily the same as the root of the application)

```

An example:

Let's say you pointed a web site application (<http://www.example.com/>) to

C:\Inetpub\wwwroot

and installed your shop application (sub web as virtual directory in IIS, marked as application) in

D:\WebApps\shop

For example, if you call Server.MapPath in following request:

<http://www.example.com/shop/products/GetProduct.aspx?id=2342>

then:

```
Server.MapPath(".")1 returns D:\WebApps\shop\products
Server.MapPath("..") returns D:\WebApps\shop
Server.MapPath("~") returns D:\WebApps\shop
Server.MapPath("/") returns C:\Inetpub\wwwroot
Server.MapPath("/shop") returns D:\WebApps\shop

```

If Path starts with either a forward (/) or backward slash (), the MapPath method returns a path as if Path were a full, virtual path.

If Path doesn't start with a slash, the MapPath method returns a path relative to the directory of the request being processed.