Select your currency:
American Dollar British Pound
22.1. Activating Friendly URLs
Prev Index Next

This tutorial covers the following sections:

Back to top

What are SEO fURLs

Search Engine-Friendly URLs (or SEO fURLs) feature is an important SEO facility which allows you to increase the traffic to your website. A fURL looks like a web address that is easy for a user and a search engine crawler to decipher (in comparison with a dirty URL - http://www.example.com/cgi-bin/gen.pl?id=4&view=basic). In other words, most search engines won't index any pages that have a question mark or other character (like an ampersand or equals sign) in the URL. That is why it is important to consider using fURLs.

Back to top

Enabling fURLs in your ViArt Shop

To setup fURLs, it is necessary to perform a few steps:

1. Create an .htaccess file and insert the following code:

<IfModule mod_rewrite.c>
RewriteEngine On 
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /friendly_url.php [L] 
</IfModule>

where

Module mode_rewite - is an Apache module that allows you to use regular expressions within an .htaccess file to rewrite your URLs.

RewriteEngine On - turns mod_rewrite on.

RewriteCond directive - defines conditions under which the rewriting should take place.

RewriteRule is the rewriting rule.

If the above Rewrite Rule does not work, then insert the below string in the .htaccess file:

ErrorDocument 404 /friendly_url.php
Note: Please, note that if ViArt Shop is running from some sub-folder, e.g. http://www.some-web-site.com/viart/ then the path to friendly_url.php script should contain /viart too, like:
RewriteRule . /viart/friendly_url.php [L]
or
ErrorDocument 404 /viart/friendly_url.php

2. When the file with the code is ready, save it and upload to the root folder of your shop.

3. Next step is to enable fURLs in the Admin panel. Go to Administration > System > System Global settings and find the settings as on the screenshot below:



Note: You can select to use different extensions for fURLs or use fURLs without extension (in the field 'Friendly Extension') and select a way to generate fURls (as shown below):



Back to top

Configuring fURLs for IIS

If you are using an IIS server, please follow the below instructions to enable fURLs:

  1. Open IIS Manager
  2. Right Click on the web site node and choose properties
  3. Click on the Custom Errors Tab
  4. Scroll down until you see the HTTP Error -- 404
  5. Double click on 404 to open the "Error Mapping Properties" dialog
  6. Change the Message Type to URL
  7. For the URL enter in /friendly_url.php
  8. Click OK and Then OK again

You can also refer to this page to get more information on this topic:http://www.prusak.com/archives/2006-01-23/ipb-seo-friendly-urls-with-iis

Back to top

Test that fURLs are configured correctly

To check whether you've set fURLs properly, please go to your site, press a category or a product. If you're correctly redirected to an appropriate category and/or product and your URL is something like: www.yoursite.com/accessories (for a category) or www.yoursite.com/item1?category_id=1 (for a product) then your fURLs are set correctly. This is an example of using fURLs without extension.

If you receive an error page (i.e. 404 error), then it is recommended to check your .htaccess file for the correct rewrite mode code.

Back to top

Working with custom fURLs

From version 3.4 ViArt php shopping cart is updated with a new feature - custom friendly URLs. Custom fURLs allow you to hide the type of script programming by removing the tell tale extension (such as .php) from your URLs for the default pages, like index.php, forum.php, etc. Before starting to work with custom fURLs, ensure that your general friendly URLs are enabled as per instructions given above. The settings for Custom fURLs are located at Administration > CMS > Custom Friendly URLs. Press the ‘Add New’ link to use custom fURL and enter a default script name in the field 'Script Name' and preferrable fURL in the field 'Friendly URL' (see the image below for a tip):



Press the ‘Add’ button and check your site. If you select to show fURLs with html extension in your Global Settings then when clicking the user_profile link you will see that the new URL will be user_login (as per your change). Quite easy:).

Back to top

How to make a redirect to 404 custom page if fURLs are enabled

To make a redirect to a custom 404 page please do the following steps:

1. Login to your ViArt Shop Admin console.

2. Navigate to Administration > CMS > Custom Pages and create a 404 custom page (as shown on the image below):



Click 'Update' to save the changes.

3. Access your site via any FTP client program and open your .htaccess file.

4. Insert the following string at the very beginning of the file:

ErrorDocument 404 /friendly_url.php

5. Save the changes and upload the updated file to the root folder of your shop.

6. Open the file 'friendly_url.php' (located in the root folder) and find such a code:

$is_friendly_url = false;
header("HTTP/1.0 404 Not Found");
header("Status: 404 Not Found");
exit;

7. Replace this code with the following:

header("HTTP/1.0 200 OK");
header("Status: 200 OK");
set_get_param("page", '404');
include_once('page.php');
return;

where '404' is the name of your custom page as created in your ViArt shop Admin console.

Note: If you do not want to create a custom 404 page in your Admin panel please add the following code to your 'friendly_url.php' file:

$echo_string = implode("",file('http://example.com/404_text.txt'));
echo $echo_string;
exit;

where '404_text.txt' is any empty text file saved in the root folder of your shop.

8. Save the changes in the 'friendly_url.php' file and upload the updated file to the root folder of your shop.

9. Open your browser and type something like: http://example.com/404, where example.com equals your actual site URL and 404 is the name of your custom 404 page. If you did everything correctly you will see your 404 custom page.

Back to top

Importing fURLs

If you have multiple products and want to update products with unique fURLs, you can use ViArt Shop importing feature. Please, follow the below steps to get information on importing fURLs:

  • Firstly, select items you would like to update, press the 'Export filtered' button (below the products list in your Admin panel) and save a .csv file to your computer. When exporting items, ensure that you select an option 'Friendly URL'.
  • Further, open a .csv file, edit/add fURL in the column 'Friendly URL' and save the file.
  • Go to your Admin panel (Administration > Products > Products&Categories, press the 'Import Products' button and select the file you've modified.
  • Press the 'Upload' button and go to the Next page:



  • Press the 'Continue' button and select products you want to import and then press the 'Import' button (see a below image):



  • If import is successful, you'll receive a success report (as shown below):



  • Check your items.
Back to top

Helpful Tips and Troubleshooting

How to create an .htaccess file

An .htaccess is a file used to administer Apache access options for whichever directory it is placed in. To create an. htaccess file, follow the instructions below:

1. Open any text editor (for example, notepad), insert necessary rewrite rule code, then save it as a text file somewhere to your computer.

2. Open Far Manager (or similar program)and change the name of the file to .htaccess (without .txt extension) (as shown on the image below):

3. Save the file and upload it to the root folder of your shop via any FTP client program.

You may get more information on creating .htacess file from the below articles:

http://www.tomrafteryit.net/creating-an-htaccess-file or http://www.apluskb.com/scripts/How_do_I_create_an_answer2168.html

Prev Index Next
ViArt - PHP Shopping Cart