LogoLogo
Build appsContact API support
  • Build apps
  • Site Templates
  • API Reference
  • Changelog
  • REST API
    • REST API overview
    • Store Profile
      • Get store profile
      • Update store profile
      • Upload store logo image
      • Delete store logo image
      • Store reports
        • Get store reports
        • Get latest store update stats
        • Get deleted items history
    • Orders
      • Search orders
      • Get order
      • Get last order
      • Calculate order details
      • Update order
      • Create order
      • Delete order
      • Get repeat order URL
      • Order invoices
        • Get order receipt PDF
        • Get tax invoices for order
        • Generate tax invoice for order
      • Order statuses
        • Search order statuses
        • Get order status
        • Update custom order status
      • Order extra fields
        • Search order extra fields
        • Update order extra field
        • Add extra fields to order
        • Delete order extra field
      • Abandonned carts
        • Search abandoned carts
        • Get abandoned cart
        • Update abandoned cart
        • Convert abandoned cart to order
      • Recurring subscriptions
        • Search recurring subscriptions
        • Get recurring subscription
        • Update recurring subscription
    • Products
      • Search products
      • Get product
      • Update product
      • Create product
      • Delete product
      • Delete all products
      • Adjust product stock
      • Get product filters
      • Get recently used product swatches
      • Search product brands
      • Product images and videos
        • Upload main product image
        • Upload main product image (async)
        • Upload gallery product image
        • Upload gallery product image (async)
        • Delete main product image
        • Delete gallery product image
        • Delete all gallery product images
        • Upload main product video
        • Upload gallery product video
        • Upload cover for gallery video
        • Delete main product video
        • Delete gallery product video
        • Download gallery product video
        • Bulk update product images and videos
      • Product files
        • Upload product file
        • Download product file
        • Delete product file
        • Delete all product files
        • Change product file description
      • Product variations
        • Search product variations
        • Get product variation
        • Update product variation
        • Create product variation
        • Delete product variation
        • Delete all product variations
        • Adjust product variation stock
        • Upload product variation image
        • Upload product variation image (async)
        • Delete product variation image
      • Product types and attributes
        • Search product types
        • Get product type
        • Update product type and attributes
        • Create product type
        • Delete product type
      • Product reviews
        • Search product reviews
        • Get product reviews stats
        • Update product review status
        • Bulk update/delete product reviews
        • Delete product review
    • Categories
      • Search categories
      • Search categories by path
      • Get category
      • Update category
      • Create category
      • Delete category
      • Category images
        • Upload category image
        • Upload category image (async)
        • Delete category image
      • Manage order of categories in the store
        • Get order of categories
        • Update order of categories
      • Manage order of products in the category
        • Get order of products
        • Update order of products
        • Assign products to the category
        • Unassign products from the category
    • Customers
      • Search customers
      • Get customer
      • Update customer
      • Create customer
      • Delete customer
      • Customer groups
        • Search customer groups
        • Get customer group
        • Update customer group name
        • Create customer group
        • Delete customer group
      • Customer contacts
        • Search customer contacts
        • Get customer contact
        • Update customer contact
        • Create customer contact
        • Delete customer contact
      • Customer extra fields
        • Search customer extra fields
        • Get customer extra field
        • Update customer extra field
        • Create customer extra field
        • Delete customer extra field
    • Discounts
      • Promotions
        • Search promotions
        • Update promotion
        • Create promotion
        • Delete promotion
      • Discount coupons
        • Search discount coupons
        • Get discount coupon
        • Update discount coupon
        • Create discount coupon
        • Delete discount coupon
    • Domains
      • Search store domains
      • Update store domains
      • Search domains for purchase
      • Purchase domain
      • Send domain verification email
      • Reset domain password
    • Dictionaries
      • Country codes
      • Currency codes
      • Currency codes by country
      • State codes by country
      • Tax classes by country
    • Staff accounts
      • Search staff accounts
      • Get staff account
      • Get staff account scopes
      • Update staff account
      • Create staff account
      • Delete staff account
      • Resend staff account invite
      • Cancel staff account invite
    • Application
      • Get app subscription status
      • Cancel app subscription
      • Get all app storage data
      • Get specific app storage data
      • Update specific app storage data
      • Delete specific app storage data
      • Add app storage data
      • Custom charge with Ecwid billing
    • Batch requests
      • Create batch request
      • Get batch status
      • Search batch requests by status
      • Stop batch request
      • Stop and delete batch request
    • Shipping options
      • Search shipping options
      • Update shipping option
      • Create shipping option
      • Delete shipping option
    • Payment options
      • Search payment options
      • Get payment option
      • Update payment option
      • Create payment option
      • Delete payment option
    • Checkout extra fields
      • Add checkout extra fields with JavaScript
      • Manage checkout extra fields with REST API
        • Search checkout extra fields
        • Get checkout extra field
        • Update checkout extra field
        • Create checkout extra field
        • Delete checkout extra field
    • Storefront widget details
      • Get page slug and static code
      • Set base URL for storefront widgets
      • Optimize custom website SEO with better URLs
        • Enable Clean Store URLs on a custom website
        • Set Custom Page Slugs on a custom website
      • Dynamic loading for storefront widget
      • SSO (Single-Sign-On) for websites
        • Add SSO to the website
        • Customize SSO on the website
        • SSO code examples
      • Static store pages
        • Static code for home page
        • Static code for category page
        • Static code for product page

Lightspeed® 2025

On this page
  • Requirements for Enabling Clean Store URLs
  • Step 1. Add server rewrite rules
  • Step 2. Add the Ecwid integration HTML code

Was this helpful?

  1. REST API
  2. Storefront widget details
  3. Optimize custom website SEO with better URLs

Enable Clean Store URLs on a custom website

Last updated 3 months ago

Was this helpful?

Clean Store URLs feature removes the hashbang (/#!/) and IDs (/p/123456) parts from product and category page URLs. For example, instead of URLs looking like: https://example.com/store/#!/product-name/p/123456, They will look like: https://example.com/store/product-name

Read more about

Requirements for Enabling Clean Store URLs

To enable Clean Store URLs on a custom website, you must have:

  • Access to its server rewrite rules

  • HTML code of the store page.

The rewrite rules will depend on the server software your website uses:

  • Apache: Use the .htaccess file. Refer to the guide on the .

  • Nginx: Modify the server configuration file. Refer to the guide on the .

  • Microsoft IIS: Use the URL rewrite module. See the guide on the .

To simplify the setup, you can use our template, which includes the Apache rewrite rules, and the HTML code to integrate the Ecwid store into your page. The template is specifically designed for Apache-based web servers.

The template works with both .htaccess and shop.html files running from the root folder on the web server:

- [web server]
  - .htaccess
  - shop.html

Depending on the page the Ecwid store works from, you need to choose one of the two template codes:

  • Ecwid store on the home page. Example product URL: https://example.com/product-name

  • Ecwid store on one of the website subpages. Example product URL: https://example.com/shop/product-name

Step 1. Add server rewrite rules

To create rewrite rules, you need to specify path to the HTML file with Ecwid store (shop.html) on the web server and the website page Ecwid works from (RewriteBase) in the .htaccess file template.

Example code (Apache-based servers):

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^.+$ shop.html
    RewriteRule ^cart$ shop.html
    RewriteRule ^search.*$ shop.html
    RewriteRule ^checkout/.+$ shop.html
    RewriteRule ^account/.+$ shop.html
    RewriteRule ^pages/.+$ shop.html
    RewriteRule ^signIn.*$ shop.html
    RewriteRule ^signOut.*$ shop.html
    RewriteRule ^resetPassword.*$ shop.html
    RewriteRule ^checkoutAB.*$ shop.html
    RewriteRule ^downloadError.*$ shop.html
    RewriteRule ^checkoutResult.*$ shop.html
    RewriteRule ^checkoutWait.*$ shop.html
    RewriteRule ^orderFailure.*$ shop.html
    RewriteRule ^checkoutCC.*$ shop.html
    RewriteRule ^checkoutEC.*$ shop.html
    RewriteRule ^checkoutAC.*$ shop.html
    RewriteRule ^FBAutofillCheckout.*$ shop.html
    RewriteRule ^pay.*$ shop.html
    RewriteRule ^repeat-order.*$ shop.html
    RewriteRule ^subscribe.*$ shop.html
    RewriteRule ^unsubscribe.*$ shop.html
</IfModule>
<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /shop/
    RewriteRule ^.+$ shop.html
</IfModule>

Step 2. Add the Ecwid integration HTML code

To create the HTML integration code that will add Ecwid store and enable Clean URLs, you need to replace all three placeholders with your store ID (STOREID) and the website subpage Ecwid works from (window.ec.config.baseUrl) in the HTML file template:

<html>

<head></head>

<body>
    <div id="my-store-STOREID"></div>
    <script>
        window.ec = window.ec || {};
        window.ec.config = window.ec.config || {};
        window.ec.config.storefrontUrls = window.ec.config.storefrontUrls || {};

        window.ec.config.storefrontUrls.cleanUrls = true;
        window.ec.config.storefrontUrls.slugsWithoutIds = true;
    </script>

    <script data-cfasync="false" type="text/javascript"
        src="https://app.ecwid.com/script.js?STOREID&data_platform=code" charset="utf-8"></script>
    <script type="text/javascript">
        xProductBrowser("categoriesPerRow=3", "views=grid(20,3) list(60) table(60)", "categoryView=grid", "searchView=list", "id=my-store-STOREID");
    </script>
</body>

</html>
<html>

<head></head>

<body>
    <div id="my-store-STOREID"></div>

    <script>
        window.ec = window.ec || {};
        window.ec.config = window.ec.config || {};
        window.ec.config.storefrontUrls = window.ec.config.storefrontUrls || {};

        window.ec.config.storefrontUrls.cleanUrls = true;
        window.ec.config.storefrontUrls.slugsWithoutIds = true;

        window.ec.config.baseUrl = '/shop/';
    </script>

    <script data-cfasync="false" type="text/javascript"
        src="https://app.ecwid.com/script.js?STOREID&data_platform=code" charset="utf-8"></script>
    <script type="text/javascript">
        xProductBrowser("categoriesPerRow=3", "views=grid(20,3) list(60) table(60)", "categoryView=grid", "searchView=list", "id=my-store-STOREID");
    </script>
</body>

</html>

Once you've added both server rewrite rules and HTML integration code, URLs added by the Ecwid store on your custom website will automatically be converted to the Clean Store URLs format.

URL features for custom websites
Apache website
Nginx website
Microsoft Learn portal