Results 1 to 3 of 3
  1. #1
    Join Date
    Feb 2009
    Posts
    22
    Plugin Contributions
    0

    Default Friendly URLs without add on module

    My site has only two categories and six products. So there ought to be a simple way to create user friendly urls without the disadvantages of an add on module.

    I would like to redirect the category page
    /index.php?main_page=index&cPath=1
    to the category page
    /cars.php
    And similar for the other category, /trucks.php

    Then would like to redirect the item page
    http:///index.php?main_page=product_...&products_id=2
    to the product page
    /ford-cars.php
    And similarly for the other products, gm-cars.php.... etc

    I think it can be done by redirecting(301) oldpage to newpage in .htaccess
    Then changing all the menu links to static links.
    Then changing site-map.htm and site-map.xml accordingly.

    Would this work?

    ******Alternatively or concurrently*****

    I would like to insert a<link rel="canonical" href="http://www.mysite.com/cars-ford.php"/> into the head of the Ford page. It would get the "cars-ford" from an entry I would create in /custom/meta-tags.php

    I have no good idea how to do this, but its probably fairly simple.

    Would this work?

    Has anyone already worked this issue out?

  2. #2
    Join Date
    May 2013
    Posts
    38
    Plugin Contributions
    0

    Default Re: Friendly URLs without add on module

    Since it is only a few products, categories, and pages, you should be able to pull this off with Apache's Mod Rewrite.

    You can hand-write the rewrites yourself. They go in your .htaccess in the root of your website.

    Here's an example I whipped up off the top of my head:

    Code:
    RewriteEngine on 
    
    RewriteRule ^/?cars$ /index.php?main_page=index&cPath=1 [L]
    RewriteRule ^/?ford-cars$ /index.php?main_page=product_info&cPath=1&products_id=2 [L]
    If you absolutely must have the ".php" on there (which I don't recommend), change it to this:

    Code:
    ^/?cars\.php$
    ^/?ford-cars\.php$
    Keep in mind that your links on the website would still show the old "main_pageblahblahblah.php" stuff. But you can give out some fancy looking urls this way, and quick. If you wanted to change how the website generated its urls for links, you'd have to edit the code, unless there's some other way I don't know about.

  3. #3
    Join Date
    Feb 2009
    Posts
    22
    Plugin Contributions
    0

    Default Re: Friendly URLs without add on module

    Thank you allthingsidLeroy

    Appreciate the help

    Larry

 

 

Similar Threads

  1. SEO friendly URLs
    By WayneSmallman in forum Templates, Stylesheets, Page Layout
    Replies: 3
    Last Post: 28 Mar 2010, 09:37 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg