GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   SEO Optimzation - Dynamic Pages coverting to static using .htaccess (https://gfy.com/showthread.php?t=541713)

rml1608 11-18-2005 01:46 AM

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 ?

paterson3713 11-18-2005 01:51 AM

Why not do something like:

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

Damian_Maxcash 11-18-2005 01:54 AM

Do a search for htacces

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

rml1608 11-18-2005 02:00 AM

Quote:

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

paterson3713 11-18-2005 02:10 AM

Quote:

Originally Posted by rml1608
Perfect, exactly what I was looking for - TYVM

no problem.

lakroze 11-18-2005 03:57 AM

cool but...

as I know google reads dynamic pages already...

or I'm wrong ?

J.P. 11-18-2005 04:59 AM

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...

J.P. 11-18-2005 05:08 AM

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

AlienQ - BANNED FOR LIFE 11-18-2005 05:09 AM

Ahh nice.

Cloaking Variant.

Watch yer selves.

Marshal 11-18-2005 05:26 AM

this post was great! exactly what i needed atm! :thumbsup

J.P. 11-18-2005 05:33 AM

Why would this be cloaking? It's a standard procedure to convert those messy queries to human readable URLs.

DirtyProfits 11-18-2005 05:49 AM

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

fuzzylogic 11-18-2005 06:52 AM

yo
booyakasha

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

rml1608 11-18-2005 07:16 AM

"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!

J.P. 11-19-2005 02:20 AM

How the hell did you break mySQL DB with mod_rewrite? :)

- Jesus Christ - 11-19-2005 02:25 AM

Quote:

Originally Posted by J.P.
How the hell did you break mySQL DB with mod_rewrite? :)

mod_deflate gave me AIDS....

be careful guys.

fallenmuffin 11-19-2005 02:29 AM

Quote:

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

SicChild 11-19-2005 02:39 AM

........

paterson3713 11-19-2005 02:41 AM

Quote:

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.

rml1608 11-19-2005 03:07 AM

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? ;)

paterson3713 11-19-2005 03:21 AM

Quote:

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.

J.P. 11-19-2005 05:41 AM

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

Screaming 11-19-2005 05:55 AM

Best of luck to you on this 1 guy.

rml1608 11-19-2005 04:25 PM

Quote:

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

uno 11-19-2005 07:47 PM

Quote:

Originally Posted by AlienQ
Ahh nice.

Cloaking Variant.

Watch yer selves.

:1orglaugh :1orglaugh :1orglaugh


All times are GMT -7. The time now is 09:54 PM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123