Aalee Ishat
Aalee Ishat

Reputation: 11

Htaccess redirection

Previously our website was in aspx version and now we have revamped to php version. We want to redirect

http://www.example.com/index.apsx?sdsd=2

to

example.com/

RewriteRule ^index\.aspx\/?(.*)$ "http\:\/\/www\.example\.com\/$1" [R=301,L]

We have used the above code but it's not properly redirecting. Its getting redirected to

http://www.example.com/?sdsd=2

Upvotes: 1

Views: 22

Answers (1)

Croises
Croises

Reputation: 18671

Use:

RewriteRule ^index\.aspx/?(.*)$ http://www.example.com/$1? [R=301,L]

With ? at the end.

Upvotes: 1

Related Questions