Forum Moderators: phranque
Some time ago I was in the process of changing my dynamic urls to static. [link]http://www.webmasterworld.com/forum92/3883.htm[/link]
The redirect wasn't working and I also had to stop due to more important things I had to do.
Today I picked this again and went a little bit further.
So I did some changes on my php script in order to fetch the page titles and put those titles on the urls.
After that I did the rewriting on htaccess and it works fine.
My problem now are the old urls. I canīt match anything as you can see....So what to do?
I thought of disallowing all those old urls on robots.txt but I will lose ranking for all dynamic pages (which make almost my entire site)....
Any thoughts?
> I canīt match anything as you can see[...]
I'm not sure what you mean here. Rewrite the static URLs to the dynamic URLs to invoke your script, and redirect the dynamic URLs to the static URLs. You'll have to use
RewriteCond %{THE_REQUEST} <METHOD>\ /<dynamic_URL_pattern\?<query_string_pattern>\ HTTP
[added] See [webmasterworld.com...] message#2. [/added]
Jim
This won't answer your current problem, but will help going forward; Tag each user post with something that identifies it as such, then use mod_rewrite to detect the identifier and do the rewrite.
E.G. /user_post/2005072211291501/whatever_title_the user_picked.html
Here, you can detect "user_post/" as an indicator the the URL should be rewritten.
Jim
People sell stuff on my site. We have widget1,2 and 3.
The new static url has offcourse a pattern that I can identify, if it hadn't I couldn't do the rewrite on the first place.
So what I have now is something like:
www.mysite.com/pagetitle-widget1-id.html
[bold]pagetitle is composed of:[/bold]
"make of the wigdet"-"model of the widget"-"description"
these are all database stored.
[id]
is a number that identifies the widget
So I may be missing something, then again I'm pretty new to this, but I can't see how to do a redirect....