help me with adding .html to my pages using htaccess

Discussion in 'Search Engine Optimization' started by Mido, Nov 10, 2006.

  1. #1
    Mido, Nov 10, 2006 IP
  2. jackslounge

    jackslounge Peon

    Messages:
    434
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #2
    The more descriptive the link text is the better - ie, dont use numbers if possible
     
    jackslounge, Nov 10, 2006 IP
  3. mihaidamianov

    mihaidamianov Well-Known Member

    Messages:
    1,434
    Likes Received:
    111
    Best Answers:
    0
    Trophy Points:
    190
    #3
    It should be quite easy, like instead of

    RewriteRule ^([_a-zA-Z0-9-]+)/([_a-zA-Z0-9-]+)/?$ /process.php?var1=$1&var2=$2
    Code (markup):
    you should write in the .htaccess file

    RewriteRule ^([_a-zA-Z0-9-]+)/([_a-zA-Z0-9-]+)[COLOR="Red"][B]\.html[/B][/COLOR]/?$ /process.php?var1=$1&var2=$2
    Code (markup):
    Err.. I think. :)

    Mihai
     
    mihaidamianov, Nov 10, 2006 IP
  4. Mido

    Mido Well-Known Member

    Messages:
    1,438
    Likes Received:
    48
    Best Answers:
    0
    Trophy Points:
    158
    #4
    this is my current htaccess can you edit it for me


    Options +FollowSymLinks
    RewriteEngine on
    RewriteRule tell/(.*)/(.*)/$ /tell.php?$1=$2
    RewriteRule download/(.*)/(.*)/$ /download.php?$1=$2
    RewriteRule code/(.*)/(.*)/$ /code.php?$1=$2
    RewriteRule file/(.*)/(.*)/(.*)/(.*)/$ /file.php?$1=$2&$3=$4
    RewriteRule file/(.*)/(.*)/$ /file.php?$1=$2
    RewriteRule funnyclip/(.*)/(.*)/$ /showfile.php?$1=$2
    RewriteRule vote/(.*)/(.*)/$ /vote.php?$1=$2


    about numbers i dont know how to change it cause its the numbers of the videos if there anyway to use video name on the title it will be good
     
    Mido, Nov 10, 2006 IP
  5. mihaidamianov

    mihaidamianov Well-Known Member

    Messages:
    1,434
    Likes Received:
    111
    Best Answers:
    0
    Trophy Points:
    190
    #5
    Options +FollowSymLinks
    RewriteEngine on
    RewriteRule tell/(.*)/(.*)\.html/$ /tell.php?$1=$2
    RewriteRule download/(.*)/(.*)\.html/$ /download.php?$1=$2
    RewriteRule code/(.*)/(.*)\.html/$ /code.php?$1=$2
    RewriteRule file/(.*)/(.*)/(.*)/(.*)\.html/$ /file.php?$1=$2&$3=$4
    RewriteRule file/(.*)/(.*)\.html/$ /file.php?$1=$2
    RewriteRule funnyclip/(.*)/(.*)\.html/$ /showfile.php?$1=$2
    RewriteRule vote/(.*)/(.*)\.html/$ /vote.php?$1=$2

    Let me know if it works
     
    mihaidamianov, Nov 10, 2006 IP
  6. Mido

    Mido Well-Known Member

    Messages:
    1,438
    Likes Received:
    48
    Best Answers:
    0
    Trophy Points:
    158
    #6
    it dosent :( it gives me not found page
     
    Mido, Nov 10, 2006 IP
  7. mihaidamianov

    mihaidamianov Well-Known Member

    Messages:
    1,434
    Likes Received:
    111
    Best Answers:
    0
    Trophy Points:
    190
    #7
    mihaidamianov, Nov 10, 2006 IP
  8. Nintendo

    Nintendo ♬ King of da Wackos ♬

    Messages:
    12,890
    Likes Received:
    1,064
    Best Answers:
    0
    Trophy Points:
    430
    #8
    RewriteRule ^tell/(.*)/(.*)\.html/$ /tell.php?$1=$2

    for example is for if the end of the URL is /

    Options +Indexes
    Options +FollowSymlinks
    RewriteEngine on
    RewriteBase /
    RewriteRule ^file/([^.]+)/([^.]+)/([^.]+)/([^.]+)\.html$ file.php?$1=$2&$3=$4
    RewriteRule ^tell/([^.]+)/([^.]+)\.html$ tell.php?$1=$2
    RewriteRule ^download/([^.]+)/([^.]+)\.html$ download.php?$1=$2
    RewriteRule ^code/([^.]+)/([^.]+)\.html$ code.php?$1=$2
    RewriteRule ^file/([^.]+)/([^.]+)\.html$ file.php?$1=$2
    RewriteRule ^funnyclip/([^.]+)/([^.]+)\.html$ showfile.php?$1=$2
    RewriteRule ^vote/([^.]+)/([^.]+)\.html$ vote.php?$1=$2

    You actually don't need as many ([^.]+) and $1. You only need it for the changing part of the URL, for example

    RewriteRule ^file/section/([^.]+)\.html$ file.php?section=$1

    for

    http-//www.site.com/file/section/32/ for sections

    instead of

    RewriteRule ^file/([^.]+)/([^.]+)\.html$ file.php?$1=$2
     
    Nintendo, Nov 10, 2006 IP
  9. Mido

    Mido Well-Known Member

    Messages:
    1,438
    Likes Received:
    48
    Best Answers:
    0
    Trophy Points:
    158
    #9
    seems like you know the way to do this but i dont know why it dosent works for me till now also i need to replace numbers with the page title it will be better i hope.
     
    Mido, Nov 10, 2006 IP
  10. Nintendo

    Nintendo ♬ King of da Wackos ♬

    Messages:
    12,890
    Likes Received:
    1,064
    Best Answers:
    0
    Trophy Points:
    430
    #10
    html$

    instead of

    html/$

    is what was wrong with the last code.

    If the numbers are required in the original URL, they'll be required in the new URLs. But you can add the page title to it if you can edit the script which would probably include search and replace to keep spaces and special characters out of the URL.
     
    Nintendo, Nov 10, 2006 IP
  11. Mido

    Mido Well-Known Member

    Messages:
    1,438
    Likes Received:
    48
    Best Answers:
    0
    Trophy Points:
    158
    #11
    tnx Nintendo can u please retype the full new htaccess code i afraid to do it wrong :)
     
    Mido, Nov 11, 2006 IP
  12. Nintendo

    Nintendo ♬ King of da Wackos ♬

    Messages:
    12,890
    Likes Received:
    1,064
    Best Answers:
    0
    Trophy Points:
    430
    #12
    It depends on how you have the URLs look when you get the titles added to the URL.

    Post a URL example for each script and I can get rid of half of the the $1 and ([^.]+) stuff.
     
    Nintendo, Nov 11, 2006 IP
  13. Mido

    Mido Well-Known Member

    Messages:
    1,438
    Likes Received:
    48
    Best Answers:
    0
    Trophy Points:
    158
  14. Nintendo

    Nintendo ♬ King of da Wackos ♬

    Messages:
    12,890
    Likes Received:
    1,064
    Best Answers:
    0
    Trophy Points:
    430
    #14
    Post URL examples of each script.
     
    Nintendo, Nov 13, 2006 IP
  15. Mido

    Mido Well-Known Member

    Messages:
    1,438
    Likes Received:
    48
    Best Answers:
    0
    Trophy Points:
    158
    #15
    i need like this script i dont have more examples now
     
    Mido, Nov 13, 2006 IP
  16. Mido

    Mido Well-Known Member

    Messages:
    1,438
    Likes Received:
    48
    Best Answers:
    0
    Trophy Points:
    158
    #16
    still waiting
     
    Mido, Nov 17, 2006 IP
  17. Nintendo

    Nintendo ♬ King of da Wackos ♬

    Messages:
    12,890
    Likes Received:
    1,064
    Best Answers:
    0
    Trophy Points:
    430
    #17
    What are you trying to do that's different from

    http://forums.digitalpoint.com/showpost.php?p=1730238&postcount=8

    The numbers have to stay in the URL. And if you posted URL examples of each of the scripts,

    file.php
    tell.php
    download.php
    code.php
    file.php
    showfile.php
    vote.php

    I could knock out half of the ([^.]+) and $1 stuff.
     
    Nintendo, Nov 17, 2006 IP
  18. Mido

    Mido Well-Known Member

    Messages:
    1,438
    Likes Received:
    48
    Best Answers:
    0
    Trophy Points:
    158
    #18
    Do u mean u need these files or to see them in action ? if u can check my site yallaclip.com i feel i miss something so i cant understand what u mean clearly.
     
    Mido, Nov 20, 2006 IP
  19. Nintendo

    Nintendo ♬ King of da Wackos ♬

    Messages:
    12,890
    Likes Received:
    1,064
    Best Answers:
    0
    Trophy Points:
    430
    #19
    URL examples for each script. For example

    download.php?something=whatever

    if you want half the ([^.]+) and $1 taken out. If you want the page title in the URL, you'll have to know how to edit the script to have them with out special characters and spaces. Otherwise, http://forums.digitalpoint.com/showpost.php?p=1730238&postcount=8 IS the code.
     
    Nintendo, Nov 20, 2006 IP
  20. Mido

    Mido Well-Known Member

    Messages:
    1,438
    Likes Received:
    48
    Best Answers:
    0
    Trophy Points:
    158
    #20
    i need the title on the page url so u can tell me the required changes i will ask my coder to make with script . Nintendo feel free to tell me the best link that has the best performance for SEO i dont need something specific i need the best results i can get to the links.
     
    Mido, Nov 21, 2006 IP