I am able to redirect URL to another URL with htaccess by using the following directive:
RewriteCond %{REQUEST_URI} ^/example$
RewriteRule (.*) /pages/example [L,R=301]
RewriteCond %{REQUEST_URI} ^/example
RewriteRule (.*) /pages/example [L,R=301]
But I want to make this with a single directive in htaccess and this directive should cover all alternatives;
http://mydomain.com/example -> http://mydomain.com/pages/example
http://mydomain.com/example/ -> http://mydomain.com/pages/example
http://mydomain.com/example/test -> http://mydomain.com/pages/example/test
How can I do this with a single .htaccess? Any thoughts?
Thanks for your help.
Try this :