I have this URL: http://www.pregnancy-layouts.com/family-silhouette/pics.php?img=bunnyset&dad=yes&mom=no&pregmom=pregmom&sister=yes&sisone=no&sistwo=no&sisthree=no&sisfor=no&brother=no&broone=no&brotwo=no&brothree=no&brofor=no&familyname=Bunny%20family Code (markup): I am trying to rewrite it, so I have this in my .htaccess. Options +FollowSymLinks RewriteEngine on RewriteRule pics-img-(.*)-dad-(.*)-mom-(.*)-pregmom-(.*)-sister-(.*)-sisone-(.*)-sistwo-(.*)-sisthree-(.*)-sisfor-(.*)-brother-(.*)-broone-(.*)-brotwo-(.*)-brothree-(.*)-brofor-(.*)-familyname-(.*)\.htm$ pics.php?img=$1&dad=$2&mom=$3&pregmom=$4&sister=$5&sisone=$6&sistwo=$7&sisthree=$8&sisfor=$9&brother=$10&broone=$11&brotwo=$12&brothree=$13&brofor=$14&familyname=$15 Code (markup): The rewritten URL should be: http://www.pregnancy-layouts.com/family-silhouette/pics-img-bunnyset-dad-yes-mom-no-pregmom-pregmom-sister-yes-sisone-no-sistwo-no-sisthree-no-sisfor-no-brother-no-broone-no-brotwo-no-brothree-no-brofor-no-familyname-Bunny%20family.htm Code (markup): Now her's my problem. While the image loads up, the family name is changed. I have no idea how or why. I tried to fix it but could not find a way.
Try this one.. RewriteEngine On RewriteRule ^([^/]*)/([^/]*)/([^/]*)/([^/]*)/([^/]*)/([^/]*)/([^/]*)/([^/]*)/([^/]*)/([^/]*)/([^/]*)/([^/]*)/([^/]*)/([^/]*)/([^/]*)\.html$ /family-silhouette/pics.php?img=$1&dad=$2&mom=$3&pregmom=$4&sister=$5&sisone=$6&sistwo=$7&sisthree=$8&sisfor=$9&brother=$10&broone=$11&brotwo=$12&brothree=$13&brofor=$14&familyname=$15 [L] Code (markup): Hope it helps
How you wanted it.. http://www.pregnancy-layouts.com/family-silhouette/pics-img-bunnyset-dad-yes-mom-no-pregmom-pregmom-sister-yes-sisone-no-sistwo-no-sisthree-no-sisfor-no-brother-no-broone-no-brotwo-no-brothree-no-brofor-no-familyname-Bunny%20family.htm Code (markup):
Try adding ^ at the beginning of your mod-rewrite code. Like.. RewriteEngine on RewriteRule ^pics-img-(.*)-dad-(.*)-mom-(.*)-pregmom-(.*)-sister-(.*)-sisone-(.*)-sistwo-(.*)-sisthree-(.*)-sisfor-(.*)-brother-(.*)-broone-(.*)-brotwo-(.*)-brothree-(.*)-brofor-(.*)-familyname-(.*)\.htm$ pics.php?img=$1&dad=$2&mom=$3&pregmom=$4&sister=$5&sisone=$6&sistwo=$7&sisthree=$8&sisfor=$9&brother=$10&broone=$11&brotwo=$12&brothree=$13&brofor=$14&familyname=$15 Code (markup): If that doesn't work try it with the "Options +FollowSymLinks" code on top.
OK, now it does not return a 404 but it does the same as with my first rewrite. The name is changed.. can`t figure out why..