Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

132
Views
How to redirect certain pages to a folder with htaccess RewriteMap from website.com/page1/ to website.com/folder/page1/

I have a .txt file with page names from an old website which I need to redirect to a folder to keep it up with the new url structure.

For example, website.com/post1/ to website.com/folder/post1/ But there are also some pages like website.com/page1/ which I don't want to redirect therefore I don't think I can use RewriteRule and want to go with RewriteMap.

I have this in my txt file calles old-urls.txt

post1 post1
post2 post2
post3 post3

I have this in my .htaccess:

ReqriteEngine on
RewriteMap oldurls "txt:/home/httpd/vhosts/website.com/httpdocs/old-urls.txt"
RewriteRule "^/(.*)" "/folder/${oldurls:$1}" [R]

Now I get 500 Internal Server error on all pages of my website. Which direction should I go?

over 4 years ago · Santiago Trujillo
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!