301 Redirect Rule

ISAPI_Rewrite is Apache mod_rewrite compatible URL rewriter for Microsoft IIS
User avatar
Posts: 5
Joined: 01 Apr 2013, 21:27
Location: Minnesota, USA

301 Redirect Rule

16 Jul 2017, 23:54

How do I 301 redirect this.

Old Website URLs:
http://www.companyurl.com/gallery.php?id=misc
http://www.companyurl.com/gallery.php?id=another-url
http://www.companyurl.com/gallery.php?id=another-url-3

Currently this rule:
RewriteRule ^gallery\.php(.*?)$ /photos/ [L,R=301]

Get's me this:
http://www.companyurl.com/photos/?id=misc

I'd like the rules to 301 redirect to:
http://www.companyurl.com/photos/

So that the "?id=misc" is removed.

Thanks

User avatar
Posts: 402
Joined: 06 Mar 2012, 11:59

Re: 301 Redirect Rule

01 Aug 2017, 07:59

Please use this:

Code: Select all
RewriteRule ^gallery\.php /photos/\? [NC,R=301]

User avatar
Posts: 3
Joined: 23 Aug 2017, 11:08

Re: 301 Redirect Rule

28 Aug 2017, 06:37

Great, that wa what i needed to know., Thanks a lot!


london-escorts-agency1

Return to ISAPI_Rewrite 3.0

Who is online

Users browsing this forum: No registered users and 7 guests