Click to See Complete Forum and Search --> : Rewriting URLs / mod_rewrite
Patrick Shannon
06-06-2007, 07:56 PM
This is something I don't have a ton of experience with and am trying to desperately figure out. Unfortunately a lot of the so-called "tutorials" are far too technical and don't really cover exactly what I'm trying to do.
So far, what I have managed to pull off is the following in my .htaccess file....
RewriteEngine on
RewriteRule ^photos.php$ ?pp_album=main
So basically, if the user types in /photos.php, it redirects them to the /$pp_album=main bullcrap URL.
But I want to do somewhat the opposite of that. If the user goes to /$pp_album=main, then I want the url to display as /photos/ or whatever for search engines, etc.
Anyone good with this stuff?
Mynock
06-06-2007, 09:22 PM
Uh huh, uh huh. Um, could you repeat the part where you said the stuff about, the things?...... The things?
http://www.anvari.org/db/cols/The_Simpsons_Characters_Picture_Gallery/Homer_Simpson.png
JPnyc
06-06-2007, 09:42 PM
I think that's backwards, Patrick. To make something more bot-friendly, it's the url you have to change, not the page it lands on. Here (http://www.yourhtmlsource.com/sitemanagement/urlrewriting.htmlhttp://www.yourhtmlsource.com/sitemanagement/urlrewriting.html) is a fairly understandable tutorial on the basics of url rewrites, however. It might help
JPnyc
06-06-2007, 09:45 PM
Curious. Well let's try it without the url tags
http://www.yourhtmlsource.com/sitemanagement/urlrewriting.html
That worked. :)
*EDIT: I looked back at the URL the original link took me to, and it somehow doubled-up the address...
Mynock
06-06-2007, 09:46 PM
He had two links together:
http://www.yourhtmlsource.com/sitemanagement/urlrewriting.html
Doesn't that make it twice as good? :D
Patrick Shannon
06-06-2007, 10:17 PM
I think that's backwards, Patrick. To make something more bot-friendly, it's the url you have to change, not the page it lands on. Here (http://www.yourhtmlsource.com/sitemanagement/urlrewriting.htmlhttp://www.yourhtmlsource.com/sitemanagement/urlrewriting.html) is a fairly understandable tutorial on the basics of url rewrites, however. It might help
The problem is that I can't outright change the URL link. Here's the thing, I'm working with a photo gallery plugin on a WordPress blog that Permalinks doesn't work on. When the gallery generates links to it's subcategories, it does them like "/?pp_album=main&pp_cat=vacations." I can't do anything to change how it links, it's how that module works. If the link could be changed to /main/vacations/, then I know how to use mod_rewrite to redirect it to "/?pp_album=main&pp_cat=vacations." But the gallery autogenerates the URLs in the crap code way, so it's no good.
What would make mod_rewrite more useful is if the "/?pp_album=main&pp_cat=vacations" link was accessed, it would change it (in appearance) to something like "/main/vacations" instead for aesthetics and search engines.
JPnyc
06-06-2007, 10:50 PM
But that's what I'm saying, a neater url in the address bar on the page you land on will not aid SEO. to do anything to aid SEO it's the link that needs to be affected. I could be wrong, I'm not an SEO expert, but I have attended a few seminars on it, and I don't think changing the appearance of the url on the target page will do anything to help index the page with search engines.
Patrick Shannon
06-06-2007, 11:03 PM
I was able to link my main menu to "/photos" and have the link go to "/?pp_album=main" (and show up in the URL as "/photos"), but as I explained it's the auto generated links leading to the sub categories that's problematic. I guess that'd be up to the module writers or doing some PHP hacking myself, but the effort wouldn't be worth it.
I wasted a good amount of time in research in which I can't bill on good conscious, so I simply told the client it couldn't be done.
I think Jpync was right in the first place when he said that what you're doing is backwards, Patrick. I'm trying to get my head around all this, but if WordPress generates the string, and tells the browser to go there, for you to redirect it to another page you would have to have that other page physically made, and not generated by Wordpress. Otherwise, if you want it to route to the WordPress generated page, you are stuck with the Wordpress URL string. I hope that makes sense...
*EDIT: Okay, from your last message it seems like you've got that figured. I wouldn't worry about it, personally. The codes are there so that you as a designer don't have to redo links and filenames every time you make a change. :) To change anything from that setup would be to consume a lot of time.
JPnyc
06-06-2007, 11:47 PM
There is software out there that can do SE friendly rewrites of dynamically generated urls. The one I know of is designed for vbulletin forums, but if they can do it with a forum, then it's possible to do.
jlknauff
06-07-2007, 06:02 PM
But that's what I'm saying, a neater url in the address bar on the page you land on will not aid SEO. to do anything to aid SEO it's the link that needs to be affected. I could be wrong, I'm not an SEO expert, but I have attended a few seminars on it, and I don't think changing the appearance of the url on the target page will do anything to help index the page with search engines.Actually, both matter quite a bit.