I have a blog that uses Wordpress and accessing a post is done with the typical Wordpress URL:
http://www.maxprog.com/blog/?p=xxx
Now I want to redirect that to:
http://www.maxprog.com/site/blog/post.php?p=xxx
I am editing my site htaccess file. The following works perfects for posts:
RedirectMatch permanent ^/blog/(.*)$ /site/blog/post.php
However it also forward URLs where pictures are stored. So instead of going here:
http://www.maxprog.com/blog/wp-content/uploads/…
it goes here:
http://www.maxprog.com/site/blog/wp-content/uploads/…
Question is, how can I forward posts only? I have tried many things so far unsuccessfully.
RedirectMatch permanent ^/blog/?p=(.)$ /site/blog/post.php?id=$1
RedirectMatch permanent ^/blog/index.php?p=(.)$ /site/blog/post.php?id=$1
RewriteRule ^blog/?p=(.)$ /site/blog/post.php?id=$1 [R=301,L]
RedirectMatch permanent ^/blog/?p=497$ /site/blog/post.php?id=497
RewriteRule ^/blog/(.)$ /site/blog/post.php(.*) [R=301,L]
…etc…
Somebody has ever faced a similar issue? … else I will have to refresh my regex knowledge :-/
Stan