Questions tagged [url]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
31
votes
1answer
8k views

What’s the recommended way to set the site URL?

There are multiple ways to set the site URL. What is the recommended way?
23
votes
4answers
7k views

Add home page to a structure?

I am using a structure for all of my site's pages (single pages and channel index pages). The structure settings are as follows: URL for Top-Level Entries: {slug} URL for Nested Entries: {parent.uri}...
17
votes
4answers
11k views

301 Redirects Appends ?p=original/url/path - how can I remove?

Whether I'm using the Reroute plugin or plugging it in .htaccess, changing the path elsewhere appends the query in the end. How can I remove? Redirect 301 /blog/category /blog/archive Is the line I ...
13
votes
6answers
6k views

Image transforms returning cpresources url

I'm trying to get Craft to render an image transform defined in the control panel. No image is added to the "filelocation/_transformhandle" folder and returns the url "/cpresources/transforms/98" ...
11
votes
3answers
2k views

How to set up {siteUrl} to work with both http and https

I'm looking for a way to set up the general.php file's siteUrl to be able to use both http and https. Only the front-end login would be using the https. This is how I currently have it set up: '...
10
votes
2answers
4k views

How can I convert text into a URL-friendly string?

If I want to convert text into a URL friendly string for sharing text in a social media link, how would I go about that?
9
votes
2answers
3k views

How would I include the first category slug in the section's entry URL format?

I have a custom section that uses routes like this: /section/category/entry_url In trying to program the search form results I realized that I need to explicitly define the entry URL format for the ...
9
votes
3answers
2k views

Entry Types Custom Slug

The website I'm working on has different sections and each section different types of entries. I would like the types of entries to be shown in the URL. I have followed this tutorial to do so. In a ...
9
votes
1answer
4k views

Method to grab URL hash in Twig or craft.request?

Is there a method or recommended way of grabbing URL hash parameters with Twig? For example, if my URL is http://mysite.com/my-page#hash, is there a way to grab the hash?
8
votes
1answer
2k views

How do I add a subcategory to the URL slug for a channel entry?

I'm trying to mimic the URL structure exactly how I have it in my old CMS. If I select an entry to have both a category and subcategory I would like to have the subcategory in the URL along with the ...
8
votes
1answer
9k views

Fetch Image URL from entry CMS

This seems like it should be really simple. I set the field for an image asset, linked it to the entry type I want it associated to, and then uploaded the image in the cms to the folder I specified. ...
7
votes
3answers
2k views

URL rewrite not working

For some reason the CraftCMS URL rewrite is not working on GoDaddy shared hosting server. Currently by .htaccess file looks like this Options +FollowSymLinks -Multiviews <IfModule mod_rewrite.c&...
7
votes
1answer
802 views

Using an IF-statement to define the Entry URL Format

Within a channel I have two kinds of possible article types, which I separate with the entry type feature. For the entry URL format I want to include the type, but only for one of the two. I've tried ...
7
votes
1answer
1k views

How to use url segments like with Freebie in EE

I'm trying to make the jump from EE to Craft but struggling in this area (and thinking I may be approaching this all wrong). In EE, I often use url segments (in combination with Freebie to ignore ...
6
votes
2answers
869 views

How do I get a random entry's URL from a Entries field?

I have a Entries field and I'd like to return a URL for one randomly picked entry. I could loop through all the entries, but I'd like to do something more efficient. Can I return an array of URLs? Or ...
6
votes
1answer
2k views

Dynamically setting a channel's Entry URL Format with Craft tags

I have a Structure section and a Channel section. Entries in the Channel will be listed on one of the Structure Entries, and it's entry page will fit the same URL format. So for example, the ...
5
votes
1answer
176 views

How do I add Entry Types to URL?

In the Sections settings ("Entry URL Format") I would like to add an entry property tag for Entry Type. discography/{slug}
5
votes
1answer
4k views

Is there a tag to get the parents url like {{entry.url}}?

Is there a tag that can shorten the following: {% set parentPage = entry.getParent() %} {% if parentPage %} <a href="{{ parentPage.url }}">{{ parentPage.title }}</a> {% endif %} ...
5
votes
1answer
388 views

How automatic slug generator could replace accentuated letters?

When typing in the title, the automatic slug generator doesn't filter or replace accentuated letters such as (ő, ú, á, ű). Is there a way to replace these letters to the unaccented one (like ő -> o, ű ...
5
votes
2answers
949 views

Get the Category name into the URL for an entry

I have a gallery which is categorised. The gallery is a Structure section where the user adds an entry and then assigns it to a category - all good. At the moment, when clicking on an entry title the ...
5
votes
1answer
684 views

How to add year and month to Entry URL Format

I'd like to make the Entry URL format of a channel look like this: /news/2015/06/my-slug-here What would I need to enter into the Entry URL Format field in order to do this? The closest I could ...
5
votes
1answer
845 views

Output URL to section

Is it possible to output the path to a given section? I'm using this to define the section model for the contact page (a single): {% set contactPage = craft.entries.section('contact') %} But then, ...
5
votes
2answers
1k views

Updating all entries URIs after changing entry URL format

After publishing some entries, I've changed the section setting "Entry URL Format" from news/{slug} to news/{id} but I had to re-save every entry to reflect the change. Is there a better and fast way ...
5
votes
1answer
370 views

Output localized urls in navigation

Does {{ url('handle') }} output the right url for localized sites? I have a fr/en site and both lang output the english paths, but shows the right content and language/strings on the page. I'm a bit ...
4
votes
1answer
251 views

Should I pluralize a channel's index slug?

Lets say I have a channel called places, which has the following URL : http://example.com/places The url points to a directory of individual places. However, when you click into an entry, each ...
4
votes
2answers
3k views

CSS is not loading on staging server

I'm quite new to server config, so this might be a simple mistake. I have a local environment setup on my computer that works just fine. I uploaded my project to my staging server at AWS and the only ...
4
votes
2answers
3k views

How do I get the url of single pages?

I've been struggling all evening with getting the urls of my singles in a menu generator. At first I thought I nailed it, but it turned out it used the title of the singles instead of the url. When I ...
4
votes
1answer
566 views

Best practice on how to hand over variables with links?

You sometime want to pass specific info from one page to another. How do you do that with twig and are there explicit Craft methods to do this? Can you do this without exposing the variable in the ...
4
votes
1answer
6k views

The requested URL was not found on this server

I've cloned an existing Craft site into MAMP Pro, set up my database in sequel pro and am able to access the site's homepage when I go to the URL I set up in MAMPS hosts. But whenever I click on a ...
4
votes
1answer
1k views

How to grab the full URL in a plugin?

When writing a plugin is there a Craft request to grab the entire url? I want to grab everything including http://domain.com/uri preferably without writing my own function. I see getUrl but craft()-&...
4
votes
1answer
467 views

Use global values in the Entry URL Format field

I'm trying to use global variables in Entry URLs generated by Craft, but they seem to be empty. Not getting any errors as such, just null. My Entry URL format looks like this: {{siteDefaults....
4
votes
2answers
910 views

URL Redirect Not Working

Seems like I can't get the base install URL to work. To get Craft to show posts I have to format the URL as, /public/index.php?p=news/2015/we-just-installed-craft Instead of just the /news/2015/we-...
4
votes
2answers
466 views

Can I use translated properties for URL formats

Here's my scenario. I have a structure section: "events". Within that I have three entry types: "events", "exhibitions", "specials". I would like the events to follow the following URL structure: {...
4
votes
1answer
194 views

Make “original” images unaccessable?

Is it possible to make the uploaded "original" images unaccessable for site visitors and make only the transforms public? I'd like to upload images in full quality, to get the best possible quality ...
4
votes
2answers
502 views

Multiple URL's for news entry?

For news entries I want both URL's www.example.com/news/678 (where 678 stands for the entry id) and www.example.com/news/some-slug to load the same entry. www.example.com/news/some-slug works fine ...
4
votes
1answer
2k views

Installing Craft in sub directory

I need to install Craft under a laravel sub-directory http://example.com/corp/ where example.com is a laravel site. Does anyone have a clean way to install craft in a directory below an existing app?...
3
votes
2answers
2k views

Using pagination on a page with url with query string data

I have an index page that filters entries based on url query strings, eg: site.com/inductees?county=123. I put together a very simple pagination setup with next/prev links. However, when I click "...
3
votes
3answers
1k views

redirect index.php in urls on Craft site to NEVER show index.php

We’ve recently had some issues with a staging site being down and it turned out the reason for this was: In the words of Brad at Pixel and Tonic, the redirect is "intercepting the update request for ...
3
votes
1answer
3k views

URL Format of a nested structure with 3 or more layers

I have a nested Structure with 3 layers like so: Home Services Service A Sub Service A Sub Service B Service B About Us Contact Now I would like the nesting to be reflected in the URL like so: ...
3
votes
2answers
234 views

Homepage Takeover

I have a problem which may be very simple to solve, but I just can't get my head around it. I would like to do an alternative landing page if an image has been uploaded to the 'homepage' single ...
3
votes
1answer
778 views

How do I make the “%20” in URL's show as “-”

I'm building a site where I am linking entries based on their tags. If you click on a tag you go to a dedicated page with all entries that share the same tag. {% for tag in craft.tags.relatedTo(entry)...
3
votes
2answers
750 views

Custom navigation URLs?

I have an existing ExpressionEngine site which I'm looking at moving to using Craft instead. Only really had a quick cursory glance at the system so far but a little confused on a few things. Say ...
3
votes
1answer
772 views

multi-environment config for {siteURL} not working

I've got a multi-environment setup working well for my database - that was easy to setup and i've had no issues getting it to work. Now i'm trying to set the siteUrl as a multi-config variable and no ...
3
votes
1answer
1k views

Is it possible to add an entry value to the entry URL Format?

I try to compose an entry URL for artists pages with first name and last name. Now: artists/{slug} = artists/{{ entry.title }} {slug} = {{ entry.title }} = Artist Last Name What I want to add at ...
3
votes
2answers
642 views

Is there a better way to localise channel url?

I'm working on a bilingual site (en and cy) and have a news channel with entry urls news/{slug} and the translated cy/newyddion/{slug}. Everything is working well with entries and if the url is ...
3
votes
1answer
2k views

Get parameters from referrer

Is there a way to get the parameters from the referrer url? I've tried this: {{ craft.request.urlReferrer.getQuery }} but that’s not working.
3
votes
1answer
2k views

Update and add POST URL parameters

How do you add extra parameters or update a parameter to an exiting POST URL? ADD EXTRA PARAMETER For example, I have a page at this address: http://localhost/shop/?color=red&order=title And ...
3
votes
1answer
619 views

Compose URL POST parameters to filter entries by category?

How do you update an URL with new params? I'm working on a search / filter entries page. I have multiple menu lists with categories in it. Like this: Size: Small Medium Large Color: Blue Red White ...
3
votes
2answers
516 views

How to persist locale in site navigation?

I've got a bi-lingual site running nicely, /en/news/news-item displays the English version and /cy/news/news-item displays the Welsh version. Great! I can't figure out how to get the URLs for the ...
3
votes
1answer
709 views

URI / Slug auto generation limitation

Craft seems to have a limitation when generating unique URI for > 100 entries with the same title..... I have a channel with YouTube videos in and some are spread across 140 parts all with the same ...