Page 1 of 2 12 LastLast
Results 1 to 10 of 15

Thread: Creating SEF URL's

  1. #1
    proweb's Avatar
    proweb is offline Joomla Developer
    Join Date
    Jan 2010
    Posts
    217
    Thanks
    4
    Thanked 24 Times in 23 Posts

    Creating SEF URL's

    Hello,

    I need some suggestions from you guys!

    I use a system, which generates search engine friendly URL's in this format:

    mysite.com/news/this is the sef url

    Do you think that this URL format will have less value than:

    mysite.com/news/this-is-the-sef-url

    Please let me know your opinion! Thanks in advance!
    Find Best Web Hosting Service. It's good or bad host? - JustHost Review
    Download free joomla themes for version 1.5 and 1.6

  2. #2
    Mike-XS's Avatar
    Mike-XS is offline XeroAgent
    Join Date
    Sep 2009
    Location
    OZ
    Posts
    209
    Thanks
    30
    Thanked 109 Times in 71 Posts
    Hi Proweb. I use this format for SEF urls on my Joomla sites, usually managed with sh404SEF.

    mysite.com/news/this-is-the-sef-url
    Although if you ever use Kunena forum, I found their SEF urls are much better with the default Joomla SEF enabled and exclude Kunena URL's from being processed by sh404SEF.

    I don't think the other way has any value at all. Leaving spaces in the urls would create urlencoding issues wouldn't it ?. I've always tried to avoid having spaces in generated urls to avoid that, looks kinda terrible.

    URLs cannot contain spaces..
    http://www.w3schools.com/TAGS/ref_urlencode.asp

    Also my J! sites that use a .html extension with SEF urls seem to do better than my sites that don't have any {.html|.php} page extension.

  3. #3
    proweb's Avatar
    proweb is offline Joomla Developer
    Join Date
    Jan 2010
    Posts
    217
    Thanks
    4
    Thanked 24 Times in 23 Posts
    Thanks for your tips. I have been using core SEF on my sites, without any extension and worked well for me. I will try out this URL extension stuff on a new sites. I don't used this feature because I don't believe in higher ranking with .html or .php extensions, but will give it a try.

    Actually, I'm modifying the search component of Joomla which does not has search engine friendly URLs. When I do a search, I always get something like this:

    ?searchword=keyword1+keyword2&ordering=newest&sear chphrase=all

    Can sh404SEF fix this problem as well or it's working only for content and other extensions? Did you tried it out?
    Find Best Web Hosting Service. It's good or bad host? - JustHost Review
    Download free joomla themes for version 1.5 and 1.6

  4. #4
    proweb's Avatar
    proweb is offline Joomla Developer
    Join Date
    Jan 2010
    Posts
    217
    Thanks
    4
    Thanked 24 Times in 23 Posts
    Is this URL formatting better?

    /search?searchword=key1+key2
    instead using this one:
    /search/key1 key2
    Find Best Web Hosting Service. It's good or bad host? - JustHost Review
    Download free joomla themes for version 1.5 and 1.6

  5. #5
    Andy101's Avatar
    Andy101 is offline Code Otaku
    Join Date
    Aug 2009
    Location
    Kanazawa
    Posts
    1,177
    Thanks
    163
    Thanked 297 Times in 224 Posts
    I don't think that mysite.com/news/this is the sef url is SE friendly due the spaces as Mike-XS hinted at.

    If you have a .htaccess file with a LAMP server you can do something like:

    Code:
    RewriteEngine On
    RewriteRule ^news/(.*) http://mysite.com/search?searchword=$1 [L]
    This would pass a search term containing dashes so your php code would need to replace them with + symbols or spaces etc.
    Last edited by Andy101; 20 November, 2010 at 14:30 PM. Reason: Oops, I got the code back to front before!

  6. #6
    proweb's Avatar
    proweb is offline Joomla Developer
    Join Date
    Jan 2010
    Posts
    217
    Thanks
    4
    Thanked 24 Times in 23 Posts
    Andy, thanks for the tip! This is working.

    I have only on problem. When the search query has 2 or more words, the URL looks like this:

    mysite.com/news/key1%2Bkey2

    Actually the system use '+' to separate the keywords. Is there any possibility to change this using .htaccess?

    Thanks again for your help!
    Find Best Web Hosting Service. It's good or bad host? - JustHost Review
    Download free joomla themes for version 1.5 and 1.6

  7. #7
    Andy101's Avatar
    Andy101 is offline Code Otaku
    Join Date
    Aug 2009
    Location
    Kanazawa
    Posts
    1,177
    Thanks
    163
    Thanked 297 Times in 224 Posts
    I think that in .htaccess you can only substitute one URL pattern for another one. After that, you have to implement some code in the destination script.

    So I think that you have to have some PHP code to replace the URL encoded + characters with something like: $url = str_replace('+', '-', $url);

    or $url = str_replace('%2B', '-', $url);

    Not sure.

  8. #8
    proweb's Avatar
    proweb is offline Joomla Developer
    Join Date
    Jan 2010
    Posts
    217
    Thanks
    4
    Thanked 24 Times in 23 Posts
    I did not managed to make working everything with htaccess, so I had to change the codes. Now it's running well and creating SEF urls. The rewrite rule has helped me a lot.

    Thanks Andy for help!
    Find Best Web Hosting Service. It's good or bad host? - JustHost Review
    Download free joomla themes for version 1.5 and 1.6

  9. #9
    TopDogger's Avatar
    TopDogger is offline Über Hund
    Join Date
    Jan 2009
    Location
    Hellfire, AZ
    Posts
    2,946
    Thanks
    341
    Thanked 883 Times in 671 Posts
    @proweb, this was mentioned by Mike-XS, but I don't think you understood.

    This:

    Code:
    mysite.com/news/this is the sef url
    is NOT a search engine friendly URL. Spaces are never allowed in a URL. A space is not a valid URL character. Unless a hexadecimal %20 is substituted in place of the space, the URL won't even work on a Unix or Linux server.

    It sounds like you may be working with a Microsoft server. MS servers allow you to do several things that are not valid on the web. You could never do that on a Linux or Unix server. Spaces are not allowed in URLs, file names or directory names. Using URL encoding will work to eliminate the spaces, but it makes a sloppy-looking URL.

    The standard search engine friendly URL would be

    Code:
    mysite.com/news/this-is-the-sef-url/
    "Democracy is two wolves and a lamb voting on what to have for lunch. Liberty is a well-armed lamb contesting the vote." -- Benjamin Franklin


  10. #10
    proweb's Avatar
    proweb is offline Joomla Developer
    Join Date
    Jan 2010
    Posts
    217
    Thanks
    4
    Thanked 24 Times in 23 Posts
    TopDogger, thanks for your replay. I understood that spaces between keywords in URL are not valid. I thought that this can be indexed by search engines. Anyway I have fixed it and I'm very happy
    Find Best Web Hosting Service. It's good or bad host? - JustHost Review
    Download free joomla themes for version 1.5 and 1.6

Page 1 of 2 12 LastLast

Similar Threads

  1. creating new websites? want to register it
    By Ladermann in forum Domaining
    Replies: 4
    Last Post: 5 August, 2011, 07:15 AM
  2. Reason for creating your website?
    By Shotgun in forum Community Building
    Replies: 9
    Last Post: 13 July, 2010, 19:18 PM
  3. Creating your new personal website?
    By shoban in forum Web Design
    Replies: 6
    Last Post: 10 July, 2009, 11:15 AM
  4. Need advice on creating an ebook
    By geekology in forum Building
    Replies: 4
    Last Post: 3 July, 2009, 03:31 AM
  5. Creating a Welcome message for SSH logins
    By mega in forum Managing
    Replies: 1
    Last Post: 14 May, 2009, 09:22 AM

Tags for this Thread

Bookmarks

Posting Permissions

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