skip to Main Content

I have about 30.000 old urls that need to be redirected
I am using excel to obtain a rewrite rule for each URL

My old URLS are using a Unique Identifier in the query string part
Basically I am trying to redirect

www.mysite.com/dettagli.asp?ID_S={965c1471-b985-45c1-9d7a-9fcede5711ed}

to

www.mysite.com/mynewurl.html

I can map any UID to the new URLS in excel but rewrite rules so far haven’t been successful

I have tried escaping the cury brackets with “” in front of them, no luck

So far I have tried

redirect 301  /dettagli.asp?ID_S={965c1471-b985-45c1-9d7a-9fcede5711ed} 

and

redirect  301  /dettagli.asp?ID_S={965c1471-b985-45c1-9d7a-9fcede5711ed} 

2

Answers


  1. Chosen as BEST ANSWER

    actually it was not that easy, at least not for me.

    I think I found a solution using:

    RewriteCond %{QUERY_STRING} ^ID_S={2e69bb2d-655e-4488-b6cd-ba6e016db346}$
    RewriteRule ^(.*)$ http://www.mywebsite.com/mynewurl.html? [R=301,L] 
    

    and so on....

    but 30.000 Urls generate 60.000 Rows in htacces which weighs more than 5MB....

    I think I 'll reconsider it


  2. Try to implement all redirect rules in php. The only thing you need set up in .htaccess in entry point for php.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search