# Newbie to Slim 3.0 with Routing issue - SOLVED

**URL:** <https://discourse.slimframework.com/t/newbie-to-slim-3-0-with-routing-issue-solved/1706>\
**Category:** Questions\
**Created:** [August 2, 2017, 3:26am UTC](https://discourse.slimframework.com/t/newbie-to-slim-3-0-with-routing-issue-solved/1706 "2017-08-02T03:26:37Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![syacko](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.slimframework.com/syacko/32/475_2.png) [@syacko](https://discourse.slimframework.com/u/syacko)\
**Post date:** [August 2, 2017, 3:26am UTC](https://discourse.slimframework.com/t/newbie-to-slim-3-0-with-routing-issue-solved/1706/1 "2017-08-02T03:26:38Z")

</div>

I have slim 3.0 installed and working, so long as I don’t change the default routing pattern in routing.php. I have read the website and looked several examples, no joy!

Routes.php:

```
<?php

// Routes

$app->get('/test', function ($request, $response, $args) {

// Sample log message

$this->logger->info("Slminfo '/' route");

// Render index view
return $this->renderer->render($response, 'index.phtml', array('name' => 'SLMINFO'));
});

$app->get('/[{name}]', function ($request, $response, $args) {
// Sample log message
$this->logger->info("Slminfo '/' route");

// Render index view
return $this->renderer->render($response, 'index.phtml', $args);
});

```

Then I run from the browser

{mydomain}/slminfo/public/index.php - works  
{mydomain}/slminfo/public/ - works  
and then  
{mydomain}/slminfo/public/test - 404 not found

What am I doing wrong?

---

<div class="post-metadata">

**Author:** ![richard-hdd](https://avatars.discourse-cdn.com/v4/letter/r/fbc32d/32.png) [@richard-hdd](https://discourse.slimframework.com/u/richard-hdd)\
**Post date:** [August 2, 2017, 4:27pm UTC](https://discourse.slimframework.com/t/newbie-to-slim-3-0-with-routing-issue-solved/1706/2 "2017-08-02T16:27:32Z")

</div>

I’m in no way an expert as I’m just trying to get Slim to work myself but if I understand the routes correctly, the first parameter is the route pattern. Currently you have `/test` but you are trying to access it using `{mydomain}/slminfo/public/test`. Maybe your route should be something like this:

```
$app->get('/slminfo/public/test', function ($request, $response, $args) {

// Sample log message

$this->logger->info("Slminfo '/' route");

// Render index view
return $this->renderer->render($response, 'index.phtml', array('name' => 'SLMINFO'));
});

```

Using the route pattern `/slminfo/public/test` instead. Unless you are using a `group` for `/slminfo/public`?

Just a thought.

---

<div class="post-metadata">

**Author:** ![syacko](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.slimframework.com/syacko/32/475_2.png) [@syacko](https://discourse.slimframework.com/u/syacko)\
**Post date:** [August 2, 2017, 4:36pm UTC](https://discourse.slimframework.com/t/newbie-to-slim-3-0-with-routing-issue-solved/1706/3 "2017-08-02T16:36:12Z")

</div>

Thank you so much for your reply. The bad news is no it didn’t work.

$app-\>get(’/test’ - no  
$app-\>get(’/public/test’ - no  
$app-\>get(’/slminfo/public/test’ - no

---

<div class="post-metadata">

**Author:** ![syacko](https://yyz2.discourse-cdn.com/flex030/user_avatar/discourse.slimframework.com/syacko/32/475_2.png) [@syacko](https://discourse.slimframework.com/u/syacko)\
**Post date:** [August 2, 2017, 5:29pm UTC](https://discourse.slimframework.com/t/newbie-to-slim-3-0-with-routing-issue-solved/1706/4 "2017-08-02T17:29:05Z")

</div>

It turned out to be an ID10T issue! I was playing around with some rewrite rules and commented the following lines in .htaccess. See below:

RewriteEngine On  
#RewriteCond %{REQUEST\_FILENAME} !-f  
#RewriteCond %{REQUEST\_FILENAME} !-d  
#RewriteRule ^ index.php [QSA,L]

Everything works fine now.
