Forum Moderators: phranque
I have one template page widget-detail.php which depending on the widget (?widget=234) how do I tell it to redirect with one line of code in my htaccess file?
redirect 301 /widgets/widget-detail.php http://www.example.com/widgets/
Thanks in advance
Options +FollowSymLinks
RewriteEngine on
#
RewriteRule ^widgets/widget-detail\.php$ http://www.example.com/widge[b]ts/?[/b] [R=301,L]
The first line of code (Options) is optional; It may or may not be required, and it may or may not be allowed on your server. This depends on your server configuration, and the only way to find out is to test.
If you add more RewriteRules in the future, you do not need to repeat the first two lines.
For more information, see the documents cited in our forum charter [webmasterworld.com] and the tutorials in the Apache forum section of the WebmasterWorld library [webmasterworld.com].
Jim
[edited by: jdMorgan at 1:41 pm (utc) on Oct. 2, 2007]