This tutorial covers the following sections:
What are SEO Friendly URLsSearch Engine Optimization Friendly URLs (or SEO FURLs) 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 friendly URLs. Enabling friendly URLs in your ViArt ShopTo setup friendly URLs, 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.phpNote: 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 friendly URLs 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 friendly URLs or use friendly URLs without extension (in the field 'Friendly Extension') and select a way to generate friendly URLs (as shown below): Configuring friendly URLs for IISIf you are using an IIS server, please follow the below instructions to enable friendly URLs:
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 Test that friendly URLs are configured correctlyTo check whether you've set friendly URLs 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 friendly URLs are set correctly. This is an example of using friendly URLs 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. Working with custom friendly URLsFrom version 3.4 ViArt php shopping cart is updated with a new feature - custom friendly URLs. Custom friendly URLs 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 friendly URLs, ensure that your general friendly URLs are enabled as per instructions given above. The settings for Custom friendly URLs 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 friendly URLs 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:). How to make a redirect to 404 custom page if friendly URLs are enabledTo 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. Importing friendly URLsIf you have multiple products and want to update products with unique friendly URLs, you can use ViArt Shop importing feature. Please, follow the below steps to get information on importing friendly URLs:
Helpful Tips and TroubleshootingHow 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. To get more information about formatting .htacess files please check Apache HTTP Server Tutorial. |