Currently our website uses custom made encrypted URLs,
for example: DOMAINNAME/index.php?case1=616c6c50726f647563747347656f7267654d617a67616c6f764d794d6f746f2e4247214023&case2=70726f6d6f47656f7267654d617a67616c6f764d794d6f746f2e4247214023
This retrieves all discounted products on our website.
We plan to rewrite URLs to make them user/SEO friendly, but we would like for old URLs (like the one above) to still work.
Which of the following options is the best to achieve this?
- Check the URL in the address bar in every site request and if those symbols are found to redirect to old urls.
or
- Use Rewrite rule to redirect everything with
index?case1=XXXX
to the new urls
Which is the fastest solution?
Could you give an example for Rewrite Rule of the given link above, to redirect to the homepage for example.
2
Answers
Thanks! and sorry.... Apache is what we are using...
decryption will be removed on the new site version. If I do an app rewrite, it will be easier to redirect to the old decryption/encryption script as the most important think for us is to not leave blank or error pages when someone is using old links posted somewhere. And this way will be easier for everything I agree.
I prefer to use server rewrites then when you say they are faster. There is a specific string always on the encrypted old URLs that I can use to make a rule in the .htaccess file.
Thanks again for your cooperation! Regards!
The fastest solution would be to do a server level rewrite (you didn’t mention what server you’re using).
I personally tend to do rewrites at the app level, because I find them easier to test and more flexible to deploy.
In your case, it seems that rewriting would involve decrypting the url, so I’m not sure how that would be done in a .htaccess file. It seems like you’d need the app loaded.