Register Advertise with usHelp Desk Today's Posts Search

Closed Thread
Thread Tools Search this Thread
Unread 22nd Feb 2016, 07:25 PM   #1
Lifetrepreneur
War Room Member
 
Kelvin Chan's Avatar
 
Join Date: 2007
Location: London, UK
Posts: 307
Thanks: 29
Thanked 79 Times in 39 Posts
Default
How to create redirect with AND without a trailing slash?
Share on: 
fb share twitter share gplus share more share

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!


Kelvin Chan is offline  
Unread 22nd Feb 2016, 11:36 PM   #2
HyperActive Warrior
War Room Member
 
Big Squid's Avatar
 
Join Date: 2009
Location: Living between LA & SD
Posts: 205
Thanks: 27
Thanked 36 Times in 33 Posts
Default
Re: How to create redirect with AND without a trailing slash?
Share on: 
fb share twitter share gplus share more share

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]
Big Squid is offline  
Unread 23rd Feb 2016, 06:27 PM   #3
Lifetrepreneur
War Room Member
 
Kelvin Chan's Avatar
 
Join Date: 2007
Location: London, UK
Posts: 307
Thanks: 29
Thanked 79 Times in 39 Posts
Default
Re: How to create redirect with AND without a trailing slash?
Share on: 
fb share twitter share gplus share more share

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]


Kelvin Chan is offline  
Unread 24th Feb 2016, 12:18 AM   #4
HyperActive Warrior
War Room Member
 
Big Squid's Avatar
 
Join Date: 2009
Location: Living between LA & SD
Posts: 205
Thanks: 27
Thanked 36 Times in 33 Posts
Default
Re: How to create redirect with AND without a trailing slash?
Share on: 
fb share twitter share gplus share more share

Originally Posted by Kelvin Chan View Post

Tks Big Squid!

Doesn't seem to work.

This .htaccess file goes into the directory of http://mydomain.com/abcxyz right?
No. It goes in the root directory of http://mydomain.com
Big Squid is offline  
Closed Thread


Bookmarks

Tags
create, redirect, slash, trailing


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




All times are GMT -6. The time now is 06:41 AM.