Recommended URL Configuration

From NeuCart Documentation
Jump to: navigation, search

There are a number of ways to display URLs for products and categories within a NeuCart store. This article discusses NeuCart's recommended configuration for URLs.

Essay.svg
This article discusses one or more best practices for configuration of a NeuCart store.
Binary-icon.png
This article discusses a
technical topic that may not be
intended for all readers.

Background

Main article: URL Preferences

By default, products show a URL like: example.com/store/productdetail.php?product=123. A URL like this is not memorable, and it is also unfriendly to search engines. Some other methods create more human-readable URLs without any external/technical configuration, like:

NeuCart allows Wikipedia-like URLs, such as: example.com/store/My_Great_Song_(MP3_Download), but this is not the preferred method. The preferred style of URL looks like this: example.com/store/my-great-song-mp3-download. NeuCart refers to this as "Custom URLs", or sometimes "Purely Custom URLs" (to distinguish from auto-alphabetical Custom URLs).

Setup

Notepad icon.svg
As with any file-writing process, the server needs to allow access for the .htaccess file to be written and for backups to be created within the folder. These permissions are determined by a store's server and its permissions; NeuCart can offer suggestions on this configuration but ultimately it is the store owner's responsibility for allowing the proper file and folder permissions.

Setup for custom URLs is done once, and it is technical, but after setting it up, a store owner never needs to think about configuration again. Custom URLs function as part of the .htaccess functionality that is present on most web servers.

.htaccess file

The server must have an .htaccess file, and as store owner you must know the folder path to that file. The file must include the lines:

## neucart start
## neucart end

Within URL Preferences, the [.htaccess location] must be configured to list the full path to the file.

NeuCart configuration

URL and Folder Name

The first thing that needs to be configured is to determine how the URLs will look: will it include the folder where your store is located or not?. Usually it is one of these choices:

  1. example.com/some-product
  2. example.com/store/some-product

Based on this decision, the URL Preferences field, [Start of Canonical Name] should be configured as one of these choices, respectively:

  1. http://example.com/
  2. http://example.com/store/

Store Folder

The [Store Folder] field in URL Preferences must be configured to indicate the folder of the store. This value is usually "store/" (based on our examples here).

Ongoing Configuration

Each product or category must be configured with the text that is the URL. This field should include the text "my-product" to make a complete URL of http://example.com/store/my-product. Any time the Custom URL text changes for a product or category, the .htaccess file is rewritten.

If, for some reason, the .htaccess file needs to be rewritten without saving a category or product, the support page includes an [Update .htaccess] section that allows this functionality.

See also

Need a question answered about the Recommended URL Configuration article? Want to offer a suggestion or correction? Click here to discuss this page.