SEO Optimzation - Dynamic Pages coverting to static using .htaccess

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rml1608
    Confirmed User
    • Sep 2004
    • 985

    #1

    SEO Optimzation - Dynamic Pages coverting to static using .htaccess

    Here is my .htaccess :

    Options +FollowSymLinks
    RewriteEngine on
    RewriteRule ^category/([0-9][0-9])$ http://www.domain-name.com/index.php?sbcat_id=$1 [R]
    RewriteRule ^category/([0-9][0-9])/$ http://www.domain-name.com/index.php?sbcat_id=$1
    RewriteRule ^joke/([0-9][0-9][0-9])$ http://www.domain-name.com/index.php?sbjoke_id=$1 [R]
    RewriteRule ^joke/([0-9][0-9][0-9])/$ http://www.domain-name.com/index.php?sbjoke_id=$1

    This works perfectly fine - however when I change it to :


    Options +FollowSymLinks
    RewriteEngine on
    RewriteRule ^category/([0-9][0-9])$ http://www.domain-name.com/index.php?sbcat_id=$1 [R]
    RewriteRule ^category/([0-9][0-9])/$ http://www.domain-name.com/index.php?sbcat_id=$1
    RewriteRule ^joke/([0-9][0-9][0-9][0-9])$ http://www.domain-name.com/index.php?sbjoke_id=$1 [R]
    RewriteRule ^joke/([0-9][0-9][0-9][0-9])/$ http://www.domain-name.com/index.php?sbjoke_id=$1

    I run into problems ...

    I am assuming I can't use [0-10000] etc, al ...

    Since I am only running into a problem when adding the 4th digit there has to be a 'programming' reason why, any programmers here have any idea ?
    ICQ : 253483920
    DICK.IN | RXAR.COM - ICQ OFFERS
  • paterson3713
    Confirmed User
    • Nov 2005
    • 190

    #2
    Why not do something like:

    RewriteRule ^joke/([0-9]+)/$ http://www.domain-name.com/index.php?sbjoke_id=$1

    Comment

    • Damian_Maxcash
      So Fucking Banned
      • Oct 2002
      • 12745

      #3
      Do a search for htacces

      Someone did a post a little while ago that really covered it well.

      Comment

      • rml1608
        Confirmed User
        • Sep 2004
        • 985

        #4
        Originally posted by paterson3713
        Why not do something like:

        RewriteRule ^joke/([0-9]+)/$ http://www.domain-name.com/index.php?sbjoke_id=$1
        Perfect, exactly what I was looking for - TYVM
        ICQ : 253483920
        DICK.IN | RXAR.COM - ICQ OFFERS

        Comment

        • paterson3713
          Confirmed User
          • Nov 2005
          • 190

          #5
          Originally posted by rml1608
          Perfect, exactly what I was looking for - TYVM
          no problem.

          Comment

          • lakroze
            Confirmed User
            • Dec 2004
            • 3527

            #6
            cool but...

            as I know google reads dynamic pages already...

            or I'm wrong ?

            Comment

            • J.P.
              Confirmed User
              • Jun 2004
              • 689

              #7
              Also you might want to consider this:

              RewriteRule ^joke/([0-9]+)/?$ http://www.domain-name.com/index.php?sbjoke_id=$1

              Note the ? sign after / and before $

              It should look like this:

              RewriteRule ^category/([0-9]+)/?$ http://www.domain-name.com/index.php?sbcat_id=$1 [R]
              RewriteRule ^joke/([0-9]+)/?$ http://www.domain-name.com/index.php?sbjoke_id=$1 [R]

              This way you need only two lines instead of four but get the same functionality...
              Webmasters! Looking for new affiliate programs to promote?
              Affiliate Program Search <-- Search for programs with FHGs, RSS feed, specific niche sponsors, ...

              Comment

              • J.P.
                Confirmed User
                • Jun 2004
                • 689

                #8
                Oops, sorry did not see the [R] at the end

                My previous post is not 100% accurate...

                I see you're trying to redirect the URLs without the trailing slash to a correct URL.

                RewriteRule ^(category|joke)/([0-9]+)$ http://www.domain-name.com/$1/$2/ [R=301]
                RewriteRule ^category/([0-9][0-9])/$ http://www.domain-name.com/index.php?sbcat_id=$1
                RewriteRule ^joke/([0-9][0-9][0-9])/$ http://www.domain-name.com/index.php?sbjoke_id=$1

                This would be the correctly optimized form... Note the [R=301] part, which forces the 301 response for your redirect...

                I assumed you want to redirect the /category/999 URLs to /category/999/ don't you? With your code you were redirecting it to /index.php?sbcat_id=999
                Webmasters! Looking for new affiliate programs to promote?
                Affiliate Program Search <-- Search for programs with FHGs, RSS feed, specific niche sponsors, ...

                Comment

                • AlienQ - BANNED FOR LIFE
                  best designer on GFY
                  • Mar 2003
                  • 30307

                  #9
                  Ahh nice.

                  Cloaking Variant.

                  Watch yer selves.

                  Comment

                  • Marshal
                    Biz Dev and SEO
                    • Jun 2005
                    • 15227

                    #10
                    this post was great! exactly what i needed atm!
                    ---
                    Busy ranking websites on Google...

                    Comment

                    • J.P.
                      Confirmed User
                      • Jun 2004
                      • 689

                      #11
                      Why would this be cloaking? It's a standard procedure to convert those messy queries to human readable URLs.
                      Webmasters! Looking for new affiliate programs to promote?
                      Affiliate Program Search <-- Search for programs with FHGs, RSS feed, specific niche sponsors, ...

                      Comment

                      • DirtyProfits
                        Confirmed User
                        • May 2005
                        • 1885

                        #12
                        Could you show me an example how that looks on a site?

                        Comment

                        • fuzzylogic
                          Confirmed User
                          • Jun 2004
                          • 4796

                          #13
                          yo
                          booyakasha

                          stop with the htaccess jokes. they is over my head.

                          Comment

                          • rml1608
                            Confirmed User
                            • Sep 2004
                            • 985

                            #14
                            "I assumed you want to redirect the /category/999 URLs to /category/999/ don't you? With your code you were redirecting it to /index.php?sbcat_id=999"

                            Sweet - that was the next issue I planned on tackling.. it was refreshing /category/999 to the /index.php?sbcat_id=999 format after putting it in the browser initially...

                            To the person who asked if Google indexes Dynamic pages, Shame on you!!! Just Kidding.. My ass got cased on HARD when I started a post about the subject a bit back ..

                            From what I have learned the last couple weeks of research they do, however they do not do it well at all. Google has hit my site with 2,450 requests and only indexed my index.html page. I think it is because EVERYTHING else on the site is dynamic - this will hopefully fix that problem.

                            Of course now my MySQL DB got screwed up somewhere along the lines last night and I have to figure out what I did there now .. No wonder I never get anything done, get something done just in time to break something that takes twice as logn to fix!
                            Last edited by rml1608; 11-18-2005, 05:18 AM.
                            ICQ : 253483920
                            DICK.IN | RXAR.COM - ICQ OFFERS

                            Comment

                            • J.P.
                              Confirmed User
                              • Jun 2004
                              • 689

                              #15
                              How the hell did you break mySQL DB with mod_rewrite?
                              Webmasters! Looking for new affiliate programs to promote?
                              Affiliate Program Search <-- Search for programs with FHGs, RSS feed, specific niche sponsors, ...

                              Comment

                              • - Jesus Christ -
                                Confirmed User
                                • Mar 2003
                                • 7197

                                #16
                                Originally posted by J.P.
                                How the hell did you break mySQL DB with mod_rewrite?
                                mod_deflate gave me AIDS....

                                be careful guys.

                                Amen

                                Comment

                                • fallenmuffin
                                  Confirmed User
                                  • Nov 2005
                                  • 8170

                                  #17
                                  Originally posted by lakroze
                                  cool but...

                                  as I know google reads dynamic pages already...

                                  or I'm wrong ?
                                  That's true but they tend not to like .ext?var=value as much as /var/value.html

                                  Comment

                                  • SicChild
                                    Confirmed User
                                    • Mar 2003
                                    • 365

                                    #18
                                    ........

                                    Comment

                                    • paterson3713
                                      Confirmed User
                                      • Nov 2005
                                      • 190

                                      #19
                                      Originally posted by fallenmuffin
                                      That's true but they tend not to like .ext?var=value as much as /var/value.html
                                      That's correct. From what I've read, google might not apply a page rank to a dynamic page with too many parameters, or maybe not even at all. Apparently sometimes it won't even index it. I think it's still a debated topic so it would probably be best to use Search Engine friendly urls.

                                      Comment

                                      • rml1608
                                        Confirmed User
                                        • Sep 2004
                                        • 985

                                        #20
                                        Debatable is putting it mildly - http://www.gfy.com/showthread.php?t=...ogle+index+php is the last thread I started before I made the decision to clean my urls .....

                                        Touchy Subject? Possibly A Reason?

                                        I must be an asswipe to ask such a question, spending 30 hours researching it was 100X as productive - no information is free nowadays, outside the VERY BASICS ;)

                                        A little bit of competition does good for a few reasons, can you guess? ;)
                                        ICQ : 253483920
                                        DICK.IN | RXAR.COM - ICQ OFFERS

                                        Comment

                                        • paterson3713
                                          Confirmed User
                                          • Nov 2005
                                          • 190

                                          #21
                                          Originally posted by rml1608
                                          Debatable is putting it mildly - http://www.gfy.com/showthread.php?t=...ogle+index+php is the last thread I started before I made the decision to clean my urls .....

                                          Touchy Subject? Possibly A Reason?

                                          I must be an asswipe to ask such a question, spending 30 hours researching it was 100X as productive - no information is free nowadays, outside the VERY BASICS ;)

                                          A little bit of competition does good for a few reasons, can you guess? ;)
                                          Well, PHP pages are fine. The thing is, when a spider comes across a dynamic page with a bunch of parameters it probably doesn't want to index it because it's not really a "page" like "mypage.html" would be, it's more like a feed or something since the content could potentially be changing every pageload. So I think that's why people tend to just use search engine friendly urls.

                                          Comment

                                          • J.P.
                                            Confirmed User
                                            • Jun 2004
                                            • 689

                                            #22
                                            Apart of being SE friendly, they're also human friendly. People will easier remember http://www.somedomain.com/category/category-name.html than http://www.somedomain.com/index.php?...objectid=55725
                                            Webmasters! Looking for new affiliate programs to promote?
                                            Affiliate Program Search <-- Search for programs with FHGs, RSS feed, specific niche sponsors, ...

                                            Comment

                                            • Screaming
                                              I can change this!!!!!
                                              • Feb 2004
                                              • 18972

                                              #23
                                              Best of luck to you on this 1 guy.

                                              Comment

                                              • rml1608
                                                Confirmed User
                                                • Sep 2004
                                                • 985

                                                #24
                                                Originally posted by paterson3713
                                                Well, PHP pages are fine. The thing is, when a spider comes across a dynamic page with a bunch of parameters it probably doesn't want to index it because it's not really a "page" like "mypage.html" would be, it's more like a feed or something since the content could potentially be changing every pageload. So I think that's why people tend to just use search engine friendly urls.
                                                Most php pages with alot of variables being called are like ..

                                                http://www.domainname.com/script.php?xxxx etc

                                                At the ? mark the search engines stop reading... at least a great deal of them do
                                                ICQ : 253483920
                                                DICK.IN | RXAR.COM - ICQ OFFERS

                                                Comment

                                                • uno
                                                  RIP Dodger. BEST.CAT.EVER
                                                  • Dec 2002
                                                  • 18450

                                                  #25
                                                  Originally posted by AlienQ
                                                  Ahh nice.

                                                  Cloaking Variant.

                                                  Watch yer selves.
                                                  -uno
                                                  icq: 111-914
                                                  CrazyBabe.com - porn art
                                                  MojoHost - For all your hosting needs, present and future. Tell them I sent ya!

                                                  Comment

                                                  Working...