Questions tagged [siteurl]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1 vote
1 answer
330 views

Moving site to subdomain

I am moving our current site to a subdomain and get this: "Craft CMS requires the PHP multibyte string extension in order to run." I have updated the $craftPath variable and System->General->...
1 vote
1 answer
39 views

I created a demo site and now want to set live url. How do I do that?

How do I tell craft to change to the new URL?
13 votes
3 answers
26k views

How to output the full page URL?

Very simple request! All I want to do is to be able to get the full URL of the page & output that in the HTML (for a 'share this page' link). Can anyone help please? Many thanks!
1 vote
1 answer
108 views

getUrl returning wrong url after site move to subdomain

I just moved my old craft site to a subdomain. I changed it in the general settings, in the config/general.php file and in the .env file. Everything works except for .getUrl(). This still returns the ...
1 vote
1 answer
145 views

Possible to have a dynamic site base URL from entry field data?

Is it possible to have a dynamic site base URL coming from an entry's field data? I want to do something like https://{entry->subdomainField}.example.com/{entry->slug} with entries coming from ...
0 votes
0 answers
272 views

Remove ID in URL

is it possible to remove ID in post URL : https://www.example.com/example/example-2/exampleexample-2464942 I mean "2464942". Thanks everyone !
1 vote
1 answer
378 views

How to make URLs translatable in Craft 3

I am trying to make the URLs translatable according to the language selected for the site.
1 vote
1 answer
131 views

global variable {{ siteUrl }} in multilingual sites

In multilingual sites the global variable {{ siteUrl }} should not point to the URL with "/de/" if it is included in the templates head section for pointing to a global js-file or css-file (...
1 vote
1 answer
164 views

Siteurl - craft.app.request.absoluteUrl() output missing "www"

How can I add "www" to the output of {{ craft.app.request.absoluteUrl }}? In my .env file I have DEFAULT_SITE_URL="https://www.mysite.com" but {{ craft.app.request.absoluteUrl() }}...
1 vote
2 answers
138 views

Craft3 - Getting rid of /web in my URL

I am very new to craft. installed craft3 very long ago, as a beginner, and trying to solve a long-lasted-issue with my url. my goal: Change my base url from www.mywebsite.com/web to www.mywebsite.com ...
0 votes
0 answers
82 views

Entry URLs are not returning URL with locale in the path

I set up 2 sites (locally) running Craft 3.6.7: English (Handle: english, Base URL: '/en/') German (Handle: german, Base URL: '/de/') I've made a blog section that is enabled for both languages with ...
0 votes
0 answers
53 views

Path issue when developing locally - /web/ folder

I'm building a Craft site locally and I'm unsure how to handle a path issue that will occur when the site goes live. My understanding is that in a live implementation, the /web/ folder will become the ...
2 votes
2 answers
3k views

If page conditions

I have an {% include%} which displays entries from a structure. This {% include%} is displayed on the homepage and other entries throughout the site. On the homepage, I'd like the include to show a ...
1 vote
1 answer
280 views

alternative global variable to siteUrl or the primary website?

I am currently developing a multilingual craft website. To include assets like styles and scripts, I have so far built the URL following the pattern "{{ siteUrl }}/assets/css/main.css". However, as ...
2 votes
1 answer
767 views

Problem with Site Running Both HTTP & HTTPs

So we're trying to set-up a site to run both HTTP & HTTPs version in parallel for SEO auditing before making the full switch to HTTPs. We followed Ben's answer on this SE question to make it work: ...
1 vote
1 answer
252 views

{{siteUrl}} not working on load

I am using {{ siteUrl }} for absolute links. It works 95% of the time. But if I press the reload button multiple times in a few seconds (overloading or something) my links look like this: href="$...
1 vote
0 answers
44 views

Override the language-part in URL and add a region (en-fr / fr-fr)

I ran into a problem one year ago, but our we changed the specifications and so it was not neccessary anymore(another question here commented). One year later now, the issue is back, harder as before ...
2 votes
1 answer
287 views

Use alias for site url based on root url defined as env var?

I was wondering if the following setup is a good practice. In my .env file I defined a single rootUrl var which contains the site root url like this: ROOT_URL="https://www.mydomain.test" In the ...
1 vote
1 answer
2k views

Invalid path alias

I'm not sure if I understand the alias concept entirely So I want to create an alias. I write a variable into my .env File: SITE_URL_DE="http://hello.local" Then I put it into my general.php File:...
5 votes
2 answers
2k 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 ...
1 vote
1 answer
59 views

The Variable {{ siteUrl }} Produces Two /es/es/ On Multisite

I'm getting example.com/es/es for my Spanish site instead of the expected example.com/es when using the {{ siteUrl }} variable. The primary site is producing the expected example.com/ Any idea of ...
4 votes
2 answers
13k views

How do I get the primary site URL?

Is there an available variable for the primary site URL in a multi-site CraftCMS setup? I need a variable that I can attach to my logo that will take the user back to the primary site. I could hard ...
2 votes
1 answer
982 views

What is the difference between siteUrl and baseUrl?

What is the difference between siteUrl and baseUrl in Craft 3? Is there any?
0 votes
1 answer
2k views

Dynamic Entry URI's for pages

This is probably very straight forward but unfortunately I can't seem to solve it. We want to create a dynamic URI structure that allows us to easily create pages and link them with parent ...
1 vote
0 answers
34 views

_entry.twig in sub folder, rich text editor images using relative URL and are therefore not found

This may be something obvious that I'm missing, but how can I make craft use absolute URLs for images add to rich text editor fields? Or use the {{siteUrl}} prior to the image src URL in order to fix ...
1 vote
1 answer
39 views

Customise the URL for an asset

I need to prepend a URL to the beginning of an asset URL in order to track stats for a podcast via Blubrry. What are the options? Specifically I need to drop the https that would appear in my URL by ...
0 votes
2 answers
59 views

Strange 'index.php' Issue

I have built and deployed dozens of Craft sites, so I know how to remove 'index.php' from urls, but now I have a site that refuses to accept my most determined efforts to remove it. This is the ...
1 vote
1 answer
2k views

Craft asset urls not working

I have checked all other questions on stack exchange with similar titles and they don't seem to help my situation. I have added assets sources to craft CMS. but when uploading I get the following ...
5 votes
3 answers
5k views

Setting the Homepage URL in Craft 3

This seems like an odd question, but I've looked through the documentation, Slack, and the StackExchange and it's weird that I'm not seeing anything... so I feel like I'm overcomplicating it. How do ...
1 vote
1 answer
801 views

How do I set my siteURL instead of having http://localhost:8888/?

I downloaded and installed Craft Personal on my computer and choose /websitetest/ as my website name. I used MAMP and phpMyAdmin to create a database. Still to access my website the url is http://...
0 votes
1 answer
96 views

Not seeing the entries in control panel

We recently moved the site from one domain to another domain (development to staging). I am able to login to control panel and see the fields and sections but when I go to entries, i dont see any ...
2 votes
2 answers
487 views

Localhost: Why does {{ asset.url }} return {{siteUrl}}/path in the browser?

I'm very new at Craft templating, and I can't seem to get an asset to link correctly in the browser. {% block content %} <article> <h1>{{ entry.title }}</h1> {{ ...
2 votes
1 answer
194 views

siteUrl in Twig templates not working

I've got a problem where siteURL wasn't working for a localized version of my site. I have a site in two languages — Russian and English, with Russian exposed under www.mysite.com and English under ...
2 votes
3 answers
430 views

Making a dynamic {{ siteUrl }} for local mobile testing

I'm developing a site using a mobile first approach, connecting the phone via USB and using Safari's Web Inspector on iOS8. On my local machine, the url for all CSS, JS and href links is http://...
7 votes
3 answers
3k 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&...
1 vote
1 answer
641 views

Get full file url, avoiding the siteUrl trailing slash

so I'm using an asset field for an OG Image. I need to get the full url for this and I've yet to find a clean way to do this. I figured I could just combine siteUrl and the asset url but I have a ...
3 votes
1 answer
930 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)...
1 vote
2 answers
163 views

siteUrl config and Control Panel conflict

I have set up environments in my config file and included a different siteUrl for each. This is so I can change the navigation on the fly. I have noticed however that siteUrl when defined in the CP ...
0 votes
1 answer
422 views

siteUrl not updating

Experiencing a headache on a client site where the siteUrl declared in general.php is not being reflected in the Control Panel (which is always showing the local siteUrl) and therefore also the ...
2 votes
1 answer
355 views

Slow Site Speed and Increasing Memory

We are experiencing incredibly slow site performance. Any tips on where to find out how much memory the site is using, or if increasing this will increase internal site loading and navigating speed? ...
1 vote
0 answers
51 views

Wrong siteUrl chosen in multi-environment config [duplicate]

I have following setup for my site urls (after other testing domains): return [ '*' => [ 'omitScriptNameInUrls' => true, 'usePathInfo' => true, '...
0 votes
1 answer
39 views

Outputting siteUrl consumes next closing tag

I'm running Craft Pro 2.3.2640. Here is the code: <span>{{ siteUrl }}</span> Here is the output: //localhost:3001/%3C/span%3E The opening tag stays intact. I am also struggling to ...
1 vote
1 answer
1k views

Adding XML Sitemaps

I've attempted to add an xml sitemap within the /public directory but received a 404 because htaccess is blocking the document. What is the proper location and method to add an xml sitemap to Craft?
11 votes
3 answers
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: '...
0 votes
1 answer
1k views

Craft\EntryModel and its behaviors do not have a method or closure named "siteUrl"

Getting the above error when trying to add a new entry to a structure section. The Section has an Entry URL Format of: {siteUrl}/{slug} In my general.php in the config folder I have: return array( ...
3 votes
2 answers
2k views

Environment specific siteUrl settings not working

I followed the advice from this and this post, but I just can't get my environment specific siteUrls to work. This is what my config file looks like: return array( '*' => array( '...
4 votes
1 answer
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()-&...
3 votes
1 answer
834 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
1 answer
721 views

Environment Variable siteURL ignored

In my general.php file I have a siteUrl environment variable declared: 'ontherocks.dev' => array( 'devMode' => true, 'environmentVariables' => array( 'siteUrl' => 'http://...
5 votes
2 answers
7k views

What's the difference between {{ siteUrl }} and url()?

Both of these things: 1. {{ siteUrl }}path/to/template 2. url('path/to/template') ... will generate this: http://mywebsite.com/path/to/template So I'm wondering, which method is preferred? Are ...