zeta1600 Posted September 24, 2007 Share Posted September 24, 2007 I am not a php programmer. But, I have done some tweaking with existing scripts to customize it... a little bit. I am working on a site using a script called Phormer. This is a php * gallery without the need for a mysql database. Of course it doesn't come with documentation. My customer is not yet willing to move to a new hosting company. It would be so much easier for me if it did so I can use an easier script. Anyway, I was wondering if any of you could help me. He wants the urls to end up with a seo friendly. Is this possible? I think it is. I have read a couple of things and tested and tweaked some Rewrite rules, but I can't seem to get it to work. Here is a couple url samples: http://www.mysite.com/plants/?p=114 http://www.mysite.com/plants/?p=50 We'd like to use words instead of the numbers. So, pulling from a * name... hope to hear from you soon. thanks in advance. Quote Link to comment https://forums.phpfreaks.com/topic/70407-need-help-with-url-rewrite/ Share on other sites More sharing options...
hackerkts Posted September 24, 2007 Share Posted September 24, 2007 Yes, sure you can do it. Let's say you want to rewrite your url from http://www.mysite.com/plants/?p=50 to http://www.mysite.com/plants/sunflower/ Options +Indexes Options +FollowSymlinks RewriteEngine on RewriteRule ^plants/([a-zA-Z-_]+)/$ plants.php?p=$1 For this occasion you will need to tweak your php script to search for the names, a little troublesome, but there's still other easier way but it includes the number. Example: http://www.mysite.com/plants/?p=50 to http://www.mysite.com/plants/sunflower-50/ Options +Indexes Options +FollowSymlinks RewriteEngine on RewriteRule ^plants/([a-zA-Z-_]+)-([0-9]+)/$ plants.php?p=$2 Quote Link to comment https://forums.phpfreaks.com/topic/70407-need-help-with-url-rewrite/#findComment-354065 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.