.htaccess file to implement multiple redirects

Posted by RobMorta on Pro Webmasters See other posts from Pro Webmasters or by RobMorta
Published on 2013-07-01T05:39:02Z Indexed on 2013/07/01 10:29 UTC
Read the original article Hit count: 233

Filed under:
|

I have a dynamic site and from .htaccess file creating clean URLs:

RewriteCond %{REQUEST_URI}  !(\.png|\.jpg|\.gif|\.jpeg|\.bmp)$
RewriteRule ^([a-zA-Z0-9_\-\+\ ]+)$ flight.php?flights=$1&slug=$1

This code worked fine for me but when I created a new type of page and trying to get clean URLs with the same code i.e.:

RewriteCond %{REQUEST_URI}  !(\.png|\.jpg|\.gif|\.jpeg|\.bmp)$
RewriteRule ^([a-zA-Z0-9_\-\+\ ]+)$ manual-page.php?url=$1&slug=$1

it's not working and if I comment the previous two lines then its is working fine.

Only one code is working at a time.

For first I have a URL domain.com/flight.php?flight-san-fransisco-london-flights and I want this being redirect to domain.com/san-fransisco-london-flights & from the second one I have domain.com/manual-page.php?url=my-new-page and I want this being redirect to domain.com/my-new-page.

Is these any way to get both working together?

© Pro Webmasters or respective owner

Related posts about htaccess

Related posts about redirects