redirect from old to new page based on id htaccess apache rules

back to snippest | Comment | Share

Redirect from old to new page based on id htaccess apache rules

 

First thing lets take this scenario after changing the permalinks inside a certain client website, old links went to 404 not found page, here is the use case:

www.sveriges-verklighet.se/archives/3135

it should be redirected to the following:

www.sveriges-verklighet.se/?p=3135

 

we should write a Rewrite Rule and Link it with a condition

Then we have to activate this condition with a RULE

 

You can test this use case on https://htaccess.madewithlove.be/

Then navigate to your htaccess file in your cpanel or if you are using greenbackend.com go to the File Manager and edit your wordpress htaccess file to the following

 

Boom, You’ve cruch it!

Thanks for reading this

-Ahmad Naser

 

About the Author

Hi! I'm Ahmad. I have a degree in Computer Science from Birzeit University and you might call me a bit of computer geek. I am the Founder of Greenbackend Turnkey Solutions a leading Cloud and Hosting Company in the Middle East, Also I am the Founder of Ahmad Naser Turnkey Solutions in Harvey, LA, USA. I'm comfortable with a large range of languages and techniques. After implementing enterprise applications using Salesforce and Siebel CRM for 3 years and with professional experience in building websites, cloud apps, iOS apps, Unity games, Android mobile apps and educational games for 8 years. I decided to share my technical knowledge with people all over the world to benefit from my experience and build their own careers specially because I am a real world example with over 20 successful apps on Google Play Store, Asset Store and Apple Store, So your success is mine and I want to help you reach your goals step by step exactly as I do. I'm passionate about teaching people about technologies, so from time to time I gave courses online and in learning centers and teach beginners and professionals on many technologies and development frameworks. One of my greatest goals in life is growing the next generation of software professionals and to keep teaching programming at every opportunity I get. I can't wait to help you experience the achievement and financial freedom that having a deep understanding of technology brings. So why not start learning to design & develop now by joining our epic Unity 3D professional 2d game development course? See you soon! Ahmad

>