Forum Moderators: phranque
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]
# 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]
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]