When using SEF URLS in your PretaShop 1.5 store, you may not like the default format. For example, the format for a product is as follows: category/id-rewrite-text-ean13.html. This URL comes from different variables strung together to give you a more human-readable format. There are four parts to the URL as shown by the color differences in the text. Below is a table displaying the separate sections:

KeywordSample CodeDescription
category music-ipods The category under which the product is listed.
id 1 The unique product ID number in the database.
rewrite text ipod-nano Thsi comes from the friendly URL field under the SEO tab of the Product Edit page.
ean13 123 This comes from the ean13 or JAN field from the Information tab of the Product Edit page.

Why change the format?
The friendly URL for an ipod nano using the sample code for each section above will be http://prestashop.inmotiontesting.com/en/music-ipods/1-ipod-nano-123.html. This URL may not suit your tastes and you may want to arrange it differently for your customers. Perhaps you want to remove the ean13 number, or move the product ID to the back, or make it appear as its own category separated by slashes. Unfortunately, you cannot remove the id entirely from the URL as it is required by PrestaShop's core coding.

Formatting Syntax
The default URL format is {category:/}{id}-{rewrite}{-:ean13}.html. The syntax is fairly straight forward, each keyword is enclosed in a set of curly braces like {}. You can add a slash (/) or a dash (-) in between keywords (outside the curly braces) to add them to the URL. For example: {category}/{id}-{rewrite} will result in category/id-rewrite. You may also notice the use of the colon (:) character. This is used within a keyword when adding a slash or a dash. {category :/} results in category/. You can use either method to add dashes or slashes. Below we will change the default URL format for our ipod nano to be more visitor friendly.

Modifying your SEF URL format in PrestaShop 1.5

  1. Log into your PrestaShop admin dashboard.
  2. Using the toolbar across the top of the page, hover over the Preferences tab and then click on the SEO & URLs option from the popup menu.
  3. Once on the SEO & URLs page, scroll down until you get to the section labeled Schema of URLs. Although there are many fields to work with, we will work with the first one, Route to products. In our example, we will remove the ean13 number from the URL by removing the keyword tag {-:ean13}. We also will add a slash instead of a dash between the product ID and the rewrite text. To do this we enter the code in the field as {category:/}{id}/{rewrite}.html
    new url format coding
  4. Once you have your desired format in place, click the green Save button in the upper right corner to save the changes. Below you can see the before and after shots for the URL formatting change.
    BeforeAfter
    format: {category:/}{id}-{rewrite}{-:ean13}.html format: {category:/}{id}/{rewrite}.html
    before url formatting change after SEF URL format changes
Did you find this article helpful?

We value your feedback!

Why was this article not helpful? (Check all that apply)
The article is too difficult or too technical to follow.
There is a step or detail missing from the instructions.
The information is incorrect or out-of-date.
It does not resolve the question/problem I have.
How did you find this article?
Please tell us how we can improve this article:
Email Address
Name

new! - Enter your name and email address above and we will post your feedback in the comments on this page!

Like this Article?

Related Questions

Here are a few questions related to this article that our customers have asked:
Ooops! It looks like there are no questions about this page.
Would you like to ask a question about this page? If so, click the button below!
Ask a Question

Post a Comment

Name:
Email Address:
Phone Number:
Comment:
Submit

Please note: Your name and comment will be displayed, but we will not show your email address.

0 Questions & Comments

Post a comment

Back to first comment | top

Need more Help?

Search

Ask the Community!

Get help with your questions from our community of like-minded hosting users and InMotion Hosting Staff.

Current Customers

Chat: Click to Chat Now E-mail: support@InMotionHosting.com
Call: 888-321-HOST (4678) Ticket: Submit a Support Ticket

Not a Customer?

Get web hosting from a company that is here to help. Sign up today!