<p>I first attempted, with the link Mats <a href="https://craftcms.stackexchange.com/questions/961/what-is-the-recommended-nginx-configuration-for-craft">posted</a>, to edit my nginx config. That resulted in a rather terrifying "can't even find the index" error, but there was a silver lining: after destroying and recreating my Vagrant the urls mysteriously fixed themselves, and I no longer see querystrings on the index. Custom routes also now work. So that's mysterious but I'll take it for now.</p>

CC BY-SA 3.0
2016-06-29T23:05:00.950Z
2016-06-29T23:05:00.950Z
2017-04-13T12:51:00.253Z
Erik G
<p>I need to set up a custom route for a particular page, but can't seem to get anything to work.</p>

<p>For instance, I set up this route:</p>

<p><a href="https://i.sstatic.net/rQfBl.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/rQfBl.png" alt="busted routes"></a></p>

<p>From what I gather, this should match just about anything... <code>mysite.dev/hello</code>, or <code>mysite.dev/goodbye</code>. But no matter what I try, I get tossed back to my index.</p>

<p>My only theory right now is that the Craft url structure is strange. I navigate around just fine, but there is no rewrite happening. So instead of <code>http://mysite.dev/site-sections/we-work-on</code>, it's <code>http://mysite.dev/index.php?p=site-sections/we-work-on</code>. I think this is because I'm developing on a Homestead box, which uses nginx and not apache.</p>

<p>Do dynamic routes depend on url rewriting?</p>

CC BY-SA 3.0
2016-06-29T00:49:50.393Z
Not sure how to answer your question, but check out https://craftcms.com/support/why-index.php and http://craftcms.stackexchange.com/questions/961/what-is-the-recommended-nginx-configuration-for-craft – it might nudge you in the right direction.
Mats Mikkel Rummelhoff
CC BY-SA 3.0
2016-06-29T03:02:44.340Z
Thanks for the links Mats -- my attempt at editing the nginx config resulted in a rather terrifying "can't even find the index" error, but there was a silver lining: after destroying and recreating my Vagrant the urls mysteriously fixed themselves, and I no longer see querystrings on the index. Custom routes also now work.

So that's mysterious but I'll take it for now -- my deadline is fast-approaching.
Erik G
CC BY-SA 3.0
2016-06-29T04:32:38.680Z
@ErikG Weird, but glad you're up and running.  Would you mind adding that as an official answer?
Brad Bell
<routing>
Do dynamic routes depend on url rewriting?
# Do dynamic routes depend on url rewriting?

(Asked by: username_0 on 2016-06-29)

I need to set up a custom route for a particular page, but can't seem to get anything to work.

For instance, I set up this route:

[![busted routes](https://i.sstatic.net/rQfBl.png)](https://i.sstatic.net/rQfBl.png)

From what I gather, this should match just about anything... `mysite.dev/hello`, or `mysite.dev/goodbye`. But no matter what I try, I get tossed back to my index.

My only theory right now is that the Craft url structure is strange. I navigate around just fine, but there is no rewrite happening. So instead of `http://mysite.dev/site-sections/we-work-on`, it's `http://mysite.dev/index.php?p=site-sections/we-work-on`. I think this is because I'm developing on a Homestead box, which uses nginx and not apache.

Do dynamic routes depend on url rewriting?

**Tags:** routing
> **Comments:**
> **username_1**: Not sure how to answer your question, but check out https://craftcms.com/support/why-index.php and http://craftcms.stackexchange.com/questions/961/what-is-the-recommended-nginx-configuration-for-craft – it might nudge you in the right direction.  
> **username_0**: Thanks for the links Mats -- my attempt at editing the nginx config resulted in a rather terrifying "can't even find the index" error, but there was a silver lining: after destroying and recreating my Vagrant the urls mysteriously fixed themselves, and I no longer see querystrings on the index. Custom routes also now work.  So that's mysterious but I'll take it for now -- my deadline is fast-approaching.  
> **username_2**: @ErikG Weird, but glad you're up and running.  Would you mind adding that as an official answer?  

---

## 1 answers

### Answer by username_0 on 2016-06-29. Score: 2

I first attempted, with the link Mats [posted](https://craftcms.stackexchange.com/questions/961/what-is-the-recommended-nginx-configuration-for-craft), to edit my nginx config. That resulted in a rather terrifying "can't even find the index" error, but there was a silver lining: after destroying and recreating my Vagrant the urls mysteriously fixed themselves, and I no longer see querystrings on the index. Custom routes also now work. So that's mysterious but I'll take it for now.


---

