Questions tagged [routing]
126 questions
4
votes
1 answer
Why is /blog not displaying /blog/index.html?
So basically, my url is mysite.com/blog which should apparently lead to /blog/index.html which is stored under templates/blog/index.html. As far as I can see I don't need to set up any routes to make it work and it should be happening as standard.…
David
- 41
- 1
3
votes
4 answers
How to set a channel as the homepage
When users enter http://www.example.com I would like to redirect them to the http://www.example.com/news template.
How could I achieve this?
Maria Stellini
- 415
- 3
- 10
3
votes
1 answer
Prevent Craft URLs containing # from redirecting
I have a Structure setup where I'd like each child to link to an anchor within the parent page (see the attached image).
But when I use and click on the link, it redirects to the parent URL without the # anchor.
e.g.…
cmal
- 815
- 4
- 14
2
votes
1 answer
Is it possible to route to www.site.com/username?
So what I'd like is:
If URI would look like {username}, load _thisTemplate.
Couldn't find the way without solid point like author ID.
Dominik Krulak
- 1,562
- 14
- 27
2
votes
3 answers
Craft Routing / Variables with Differing URI
I have a project which I'm working on which is going to need something similar to the following URL Structure :
site.com/dfe45c4f/news_title, site.com/gyb66dx/news_title or site.com/76vvg3s/news_title
The First URI Segment is the 'Partner Reference'…
madebyhippo
- 175
- 5
1
vote
1 answer
Dynamic URL generated by a custom field dropdown value
I have a special case where the URL needs to be defined from within the entry itself. I have a dropdown that I want to populate with the URLs as values.
Can the dropdown value be used to generate the URL? I can not use custom site URLs because the…
Hopstad
- 25
- 4
1
vote
1 answer
Nginx config for craft working for everything but admin url's
I am trying to configure NGINX to serve a craft 2 site. I am getting the requests being routed through index.php for template url's but not for any admin routes which are redirecting to index.php?p=/admin/**/*.
I am assuming this has more to do…
9er
- 179
- 9
1
vote
1 answer
How do I do routing for something like {city}/pricing, {city}/how-it-works, etc. while loading the same template and dataset?
I'm trying to set up a site for clients that have locations in multiple cities and who want to be able to display something specific to that location on certain pages. I would like to set up routes using the city name as a variable, followed by the…
GMStevens
- 13
- 2
1
vote
1 answer
Do dynamic routes depend on url rewriting?
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:
From what I gather, this should match just about anything... mysite.dev/hello, or mysite.dev/goodbye. But no matter…
Erik G
- 103
- 4
1
vote
1 answer
Route / to specific template
I'm trying to route the homepage / to a specific template. In my routes.php file, i've tried these two without result:
return array(
'/' => 'specific/_entry',
'' => 'specific/_entry',
);
Fred Carlsen
- 2,997
- 13
- 23
0
votes
1 answer
How can I reroute this querystring URL?
In my routes file I have this:
'micros-test/guest-booking/(?P[a-z0-9-]*)' => 'micros-test/guest-booking',
Which works fine for URLS like this:
/en/micros-test/guest-booking/some-valid-alphanumeric-id
However I need to add another that…
Russ Back
- 1,503
- 13
- 26
0
votes
1 answer
Direct access call for a twig template from a twig template gives 404
I'm trying to call for a Twig template _template from a Twig template, particularly from within AngularJS