404 error if folder in public_html has same name as folder in craft/templates I am currently transfering a live website to Craft CMS. I am trying to keep all URLs of pages and images exactly the same as the live version, because of all the pages and images cached in Google. Current URL's are, for example:

http://www.website.com/projects/projectname-1/pictures/picture.jpg

Where projectname-1 and picture.jpg are variable.

In Craft CMS I made a structure called projects. The slug/uri of the entries are setup so that they are the same as the original URL (for example www.website.com/projects/projectname-1)

I made an Asset source with the file system path set as projects/ and asset url as /projects/. When creating an entry within the projects structure, I made it so that when you're adding the images (custom field), it created the subfolder like: projects/{slug}/. The filenames of the images I am uploading are the exact same name as the live version. This all together works, because I am recreating all the same URLs: nice! :)

Now, here comes the problem. I also made a Single for the projects (www.website.com/projects/) page. When I create an index.twig file in craft/templates/projects/index.twig, I get a 404 error when visiting the URL. This is because I also have a folder called projects in my public_html. So, my question is: how do I also show craft/templates/projects/index.twig on my projects Single, while also keeping the original URLs intact (thus at the same time having a /projects/ folder in my public_html).

Hope it makes sense, thanks,

ET
This is because the 'projects' folder exists in both public_html and craft/templates, right?


No this simply means that you have no entry with the slug projects as soon as you create an entry with the given slug it will work.

You can also define a route in a config file 

'projects ' =&gt; 'projects/index.twig',


Generally your template path structure has nothing to do with your url structure. You should define which template should apply for which url route in your CP in the element settings or via config file or plugin

public function registerSiteRoutes()
{
    return array(
        'projects' =&gt; 'projects/index.twig'
    );
}