How to create redirect with AND without a trailing slash?

by 3 replies
3
Hi,


I want to redirect people who go to either...
1) http://mydomain.com/abcxyz
2) http://mydomain.com/abcxyz/


To go to...
http://myotherdomain.com
How do I do it?


Tks much!
#programming #create #redirect #slash #trailing
  • You can use the .htaccess file.

    This code should work:

    Code:
    RewriteEngine on
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^abcdef/?$ http://myotherdomain.com [NC,L]
    • [1] reply