Results 1 to 1 of 1
-
17th Sep 2012, 05:37 PM #1OPMember
Redirect from one site to another site using .htaccess
Hello,
I'm looking for a way to redirect users from one website to another.
But there's something special.
I don't want this:
www.oldsite.tld/file1 -> www.newsite.tld
I want this:
http://www.oldsite.tld/somerandomdir...somerandomfile -> http://somerandomdirectory/anotherra...somerandomfile
With "somerandomfile" I mean a totally random file, there can be 1000's of these. So I don't want a .htaccess file with a 1000 lines, just this one. Which mean only "oldsite.tld" has to be replaced and the rest of the string needs to stay unchanged.
I've also been thinking if it would be possible to apply this to everything but to "/admin", not sure if that would work.
I know this is possible, I've tried a few things with "$" but I can't get it working.
This is the code I already have from the current site:
Code:RewriteEngine On RewriteRule ^/?sport-events/([a-zA-Z]+)/([a-zA-Z0-9-]+) index.php?menu=sport-events&event_type=$1&sport=$2 [L] RewriteRule ^/?sport-events/([a-zA-Z]+) index.php?menu=sport-events&event_type=$1 [L] RewriteRule ^/?sport-events index.php?menu=sport-events [L] RewriteRule ^/?event/([0-9]+) index.php?menu=event&event_id=$1 [L] RewriteRule ^/?feed rss.php [L] RewriteRule ^/?moviefeed movierss.php [L] RewriteRule ^/?watch/([a-z0-9-/]+)$ index.php?menu=watchmovie&perma=$1 [L] RewriteRule ^/?tvtag/([a-z0-9_/]+)$ index.php?menu=tv-tag&tag=$1 [L] RewriteRule ^/?movietag/([a-z0-9_/]+)$ index.php?menu=movie-tag&tag=$1 [L] RewriteRule ^/?([a-z0-9-/]+)\.html$ index.php?menu=$1 [L] RewriteRule ^/?pages/([a-z0-9-/]+) index.php?menu=page&permalink=$1 [L] RewriteRule ^/?tv-shows/(\d+)$ index.php?menu=tv-shows&p=$1 [L] RewriteRule ^/?tv-shows index.php?menu=tv-shows [L] RewriteRule ^/?channel/(\d+)$ index.php?menu=channel&channel_id=$1 [L] RewriteRule ^/?live-channels index.php?menu=live-channels [L] RewriteRule ^/?register index.php?menu=register [L] RewriteRule ^/?logout index.php?menu=logout [L] RewriteRule ^/?login index.php?menu=login [L] RewriteRule ^/?home index.php?menu=home [L] RewriteRule ^/?movies/(\d+)$ index.php?menu=movies&p=$1 [L] RewriteRule ^/?movies index.php?menu=movies [L] RewriteRule ^/?([a-zA-Z0-9-]+)/season/([0-9]+)/episode/([0-9]+)$ index.php?menu=episode&perma=$1&season=$2&episode=$3 [L] RewriteRule ^/?([a-zA-Z0-9-]+)/season/([0-9]+)$ index.php?menu=show&perma=$1&season=$2 [L] RewriteRule ^/?([a-zA-Z0-9-]+)/feed$ rss.php?perma=$1 [L] RewriteRule ^/?([a-zA-Z0-9-]+)$ index.php?menu=show&perma=$1 [L]
Thanks a ton!NaHoW Reviewed by NaHoW on . Redirect from one site to another site using .htaccess Hello, I'm looking for a way to redirect users from one website to another. But there's something special. I don't want this: www.oldsite.tld/file1 -> www.newsite.tld I want this: www.oldsite.tld/somerandomdirectory/anotherrandomdirectory/somerandomfile -> somerandomdirectory/anotherrandomdirectory/somerandomfile Rating: 5
Sponsored Links
Thread Information
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)
Similar Threads
-
.htaccess redirect
By batori in forum Webmaster ResourcesReplies: 6Last Post: 29th Sep 2012, 05:14 PM -
.htaccess 302 redirect
By av0id in forum Technical Help Desk SupportReplies: 2Last Post: 6th Mar 2012, 01:52 AM -
How to Redirect using htaccess
By AJ Blacklisted in forum Web Application/Script SupportReplies: 4Last Post: 20th Dec 2011, 08:38 AM -
[SEO Related] Redirect PR / Traffic From Established Site > New Site
By viruz99 in forum Webmaster DiscussionReplies: 13Last Post: 20th Dec 2011, 03:40 AM
themaCreator - create posts from...
Version 3.22 released. Open older version (or...