How to create redirect with AND without a trailing slash?

3 replies
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!
#create #redirect #slash #trailing
  • Profile picture of the author Big Squid
    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]
    {{ DiscussionBoard.errors[10552824].message }}
    • Profile picture of the author Kelvin Chan
      Tks Big Squid!

      Doesn't seem to work.

      This .htaccess file goes into the directory of http://mydomain.com/abcxyz right?

      Originally Posted by Big Squid View Post

      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]
      Signature

      {{ DiscussionBoard.errors[10554242].message }}

Trending Topics