Forum Moderators: phranque

Message Too Old, No Replies

Problems with PageRank using Apache Rewrites

Not passing PR to "Engine Friendly" URL's?

         

kabbink

10:19 pm on Jan 25, 2009 (gmt 0)

10+ Year Member



Hey guys,

I am using what I thought to be a standard convention to create SE and user friendly URL's but it appears that Google isn't indexing the stuff or giving it a PR. I must have done something wrong!

Here is what I have in my .htaccess:

RewriteRule ^products/(.*)$ products.php?$1 [L]

This way I can link to example.com/products/BlueWidgets.html and my file products.php will be loaded and parses the URI in order to serve the right page.

I have done this before with AddHandler but this host doesnt support it. Should I just switch hosts or what?

Thanks!

[edited by: phranque at 1:56 am (utc) on Jan. 26, 2009]
[edit reason] exemplified url [/edit]

phranque

2:01 am on Jan 26, 2009 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



that's an internal rewrite, so the .html url is the one that should be indexed.
are any of your urls being indexed?

kabbink

5:55 pm on Jan 26, 2009 (gmt 0)

10+ Year Member



Yes. All my URL's are being indexed and are PR3-4 except for the ones behind the rewrite...

phranque

11:44 am on Jan 27, 2009 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



i'm still not clear on your expectations.
do you want the .html url indexed or the .php url indexed?

what response are you getting when you request those urls?

kabbink

4:22 pm on Jan 27, 2009 (gmt 0)

10+ Year Member



The HTML page should be indexed. The URL the SE sees is:

mydomain.com/products/Blue-Widget.html

I don't know what you mean by what response I am getting exactly but when I click the link everything looks normal.

Let me know what other questions you have.

Shaddows

5:05 pm on Jan 27, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



You need to get an add-on such as Live HTTP Headers. Get that, follow the link and post the (exemplified) results.

jdMorgan

5:53 pm on Jan 27, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If you want to "hurry up" the search engines' passing the PR from your old "unfriendly" dynamic URLs to your new "friendly" static ones and avoid duplicate-content (having the same page at two or more URLs), then add this code:

# Externally redirect direct client requests for dynamic URLs to static equivalents
RewriteCond %{THE_REQUEST} ^[A-Z]+\ /products\.php(\?([^\ ]*))?\ HTTP/
RewriteRule ^products\.php$ http://www.example.com/products/%2? [R=301,L]

With this new rule in place, any client attempt to load the URL example.com/products.php?<anything> will result in a 301-Moved Permanently redirect to the URL example.com/products/<anything>. Then, when the client requests this new URL, your existing internal rewrite rule will pass the request to your script at the filepath /products.php?<anything>

If you already have other redirect rules, such as a rule that redirects any non-www domain requests over to your www domain, then put this new rule *above* that one; Generally, your rules should be organized with external redirects first, in order from most-specific (affecting the fewest URLs) to least-specific, followed by your internal rewrites, again in order from most-specific to least-specific.

Flush your browser cache completely before testing any new server-side code.

Jim

[edited by: jdMorgan at 5:55 pm (utc) on Jan. 27, 2009]

phranque

8:46 pm on Jan 27, 2009 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



have your .php urls been previously indexed?