0

how can I redirect this url:

http://www.indianastro.co.il/index.php?id=moon

to this:

http://www.indianastro.co.il/?p=217

via .htaccess

2
  • How is moon related to 217? Commented Jun 7, 2012 at 9:01
  • New site build on wordpress. The old one was on custom system. Please help me... Commented Jun 10, 2012 at 4:58

1 Answer 1

1

If there's no relation between the two identifiers (moon => 217) you could use RewriteMap. Based on the example in the docs:

RewriteMap oldsite2wordpress txt:/etc/apache2/oldsite2wordpress.txt
RewriteRule ^index.php?id=(.*) /?p=${oldsite2wordpress:$1|NOTFOUND} [PT]

Then you define the mappings in /etc/apache2/oldsite2wordpress.txt

##
## oldsite2wordpress.txt - Maps old website IDs to WordPress IDs
##

moon 217
earth 87
sun 997
...
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.