TP-Docs
HTML5 Icon HTML5 Icon HTML5 Icon
TP on Social Media

Recent

Welcome to TinyPortal. Please login or sign up.

Members
Stats
  • Total Posts: 196,004
  • Total Topics: 21,330
  • Online today: 72
  • Online ever: 8,223 (February 19, 2025, 04:35:35 AM)
Users Online
  • Users: 0
  • Guests: 47
  • Total: 47

URL specific forwarders ?

Started by MoreBloodWine, February 03, 2011, 10:47:50 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

MoreBloodWine

I know I can do forwards and stuff through my cPanel but for what I have in mind that only solves half my problem while opening up a bigger can of worms I'd rather not get in to. In any case, I know I can make a index.php file that will do a forward to a named URL but I want, rather need to sort of "trick" it out if possible. Hope I describe this well, but I will say that this needs to be VERY specific and only forward the URL's it's told to.

It will also need to account for http://address.com, http://www.address.com or just www.address.com

The named (forward to) address I would like to have set as a variable so there's only just the one instance of it. Maybe something like $forwardto = "youraddresshere.com";

eojmarket.com => $forwardto
eojmarket.com/index.php => $forwardto/index.php

Here's where it might get tricky...

eojmarket.com/index.php?whatever follows the question mark... => $forwardto/index.php?whatever follows the question mark...

Example: http://www.eojmarket.com/index.php?topic=1619.msg11408#msg11408 => $forwardto/index.php?topic=1619.msg11408#msg11408

Again, this would have to be link specific forwarding so it wouldnt mess with something like this...

http://www.eojmarket.com/NonForumStuff/TurtlePics/CustomStand.jpg


and turn it in to something like this...

$forwardto/NonForumStuff/TurtlePics/CustomStand.jpg


Anyway, if this is possible and you can code all the specifics for me in a index.php file that would be great and appreciated.

Edit: To make testing easy on my end we can make the base URL in this case eojmarket.com a variable as well, maybe something like $forwardfrom but ahain we'd have to account for the different URL variations that people might use like listed above and again below.

http://address.com, http://www.address.com or just www.address.com
Download my custom SMF 1.x / 2.x Who.template.php
Get 15% off using coupon code xjz3918744 here where all your video editing needs can be met !
Design your own sig @ myu2sig.com - Gen Status: - Total unique user count:

IchBin

Your description is very hard to follow. I don't understand what the purpose is or why you are doing this? How are people accessing these URL's you want changed? I don't understand at all what you are trying to achieve...

Lesmond

I have to agree with ichbin on this one, I really don't see what you are trying to do with this?

MoreBloodWine

Moving my forum to a new URL but still want people to be able to access their bookmarks for eojmarket.com/index.php?whatever etc and eojmarket.com is the base URL for my host account and I have things in the top level public_html folder that would still use the eojmarket.com link which is why I need URL specific forwarding.

Not to hard to follow, you just have to sit down and really think about what I'm askng to understand it even though I felt my initial description was clear.
Download my custom SMF 1.x / 2.x Who.template.php
Get 15% off using coupon code xjz3918744 here where all your video editing needs can be met !
Design your own sig @ myu2sig.com - Gen Status: - Total unique user count:

IchBin

You think you clearly explained it, but you did not even specify that you were moving URL's. You didn't specify that you needed to capture from one Domain and pass it to another Domain name. There are a lot of details that I'd need to know the specifics of.  Are you staying on the same domain and just moving your forum into a folder? Or are you moving it to a totally different domain? Are the only links you want to capture the forum links from index.php?xxx ? From the sounds of it, this would be much better to do with an apache rule. Apache rules are much better than writing php code to do it.

MoreBloodWine

Quote from: IchBin on February 05, 2011, 12:03:35 AM
You think you clearly explained it, but you did not even specify that you were moving URL's. You didn't specify that you needed to capture from one Domain and pass it to another Domain name. There are a lot of details that I'd need to know the specifics of.  Are you staying on the same domain and just moving your forum into a folder? Or are you moving it to a totally different domain? Are the only links you want to capture the forum links from index.php?xxx ? From the sounds of it, this would be much better to do with an apache rule. Apache rules are much better than writing php code to do it.
moving my site from /publib_html/ to /public_html/my_site/ and even changing the URL, thats why I want specific forwarders.

So if a user goes to eojmarket.com they get forwarded to mysite.com if they go to eojmarket.com/index.php?whatever they get forwarded to mysite.com/index.php?whatever

Again the specifics of it cannot mess with things like eojmarket.com/pictures/picture.jpg meaning that I wouldnt want a user to try and call that picture but cant because they got forwarded to mysite.com/pictures/picture.jpg

As stated before, it would have to account for the three different URL variations http://www.mysite.com, www.mysite.com & mysite.com

Anyway, if your talking about adding stuff to my htaccess file thats doable to... if it matters, my servers linux.

Here's what's in my htaccess file now if it matters...


suPHP_ConfigPath /removed/removed/public_html

RewriteEngine on

RewriteCond %{HTTP_HOST} ^turtle-tv.eojmarket.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.turtle-tv.eojmarket.com$ [OR]

RewriteCond %{HTTP_HOST} ^eojmarket.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.eojmarket.com$
RewriteRule ^nikoslivevid\/?(.*)$ "http\:\/\/www\.turtle\-tv\.com\/$1" [R=301,L]

RewriteCond %{HTTP_HOST} ^myu2sig.eojmarket.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.myu2sig.eojmarket.com$ [OR]

RewriteCond %{HTTP_HOST} ^eojmarket.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.eojmarket.com$
RewriteRule ^U2Signatures\/?(.*)$ "http\:\/\/www\.myu2sig\.com\/$1" [R=301,L]

Options +FollowSymLinks -Indexes

<Files 403.shtml>
order allow,deny
allow from all
</Files>
Download my custom SMF 1.x / 2.x Who.template.php
Get 15% off using coupon code xjz3918744 here where all your video editing needs can be met !
Design your own sig @ myu2sig.com - Gen Status: - Total unique user count:

IchBin

Ok so I need to know exactly the locations. I can't figure out what the rewrite rules need to be if you can't give me specific locations.

Old site and URL?
www.eojmarket.com in all it's variations. Forward everything from this URL?

New site URL? Is the forum in the root or in a folder in the new domain? Exact locations please.

When you refer to the images you don't want people to get redirected to wrong, are they going to be in the same location in the new domain you're moving to?

MoreBloodWine

Quote from: IchBin on February 05, 2011, 01:54:11 AM
Ok so I need to know exactly the locations. I can't figure out what the rewrite rules need to be if you can't give me specific locations.

Old site and URL?
www.eojmarket.com in all it's variations. Forward everything from this URL?

New site URL? Is the forum in the root or in a folder in the new domain? Exact locations please.

When you refer to the images you don't want people to get redirected to wrong, are they going to be in the same location in the new domain you're moving to?
Everything I don't want messed up will be staying top level in /public_html/ while the site will be gettign moved to /public_html/eojmp/ with it's new URL that I don't have picked out yet. Trying to take a vote from my users to see what they might like. Lets just for arguments sake go with mysite.com and I can change every instance of mysite to the new URL when it's been picked. No don't forward everything from that URL eojmarket.com becuae like I said I don't want people to try and call a image on eojmarket.com which is in /public_html/ and get forward /public_html/eojmp/ where the image does no exist.

If someone calls eojmarket.com via http://www.eojmarket.com or www.eojmarket.com or even eojmarket.com they should get forward to http://www.mysite.com

Same for the forum stuff if someone calls http://www.eojmarket.com/index.php?whatever or www.eojmarket.com/index.php?whatever or even eojmarket.com/index.php?whatever they should get forward to http://www.mysite.com/index/php?whatever

As for variations, there's only the three named since http://www.eojmarket.com, www.eojmarket.com or just eojmarket.com

Since it's my top level domaing that points to /public_html/ there's nothing to worry about with say like my site myu2sig.com which in it's raw enedited link would be myu2sig.eojmarket.com or to get technical eojmarket.com/U2Signatures/

Edit: The new URL when figured out will point to a second level folder where the site is being moved / condensed in to to takee it out of top level so the site as it stands is in /public_html/ and will be getting moved to /public_html/eojmp/ which is where the new URL will point to when setting up the domain stuff so when a user types in newurl.com is takes them to the right folder(s) on my account.
Download my custom SMF 1.x / 2.x Who.template.php
Get 15% off using coupon code xjz3918744 here where all your video editing needs can be met !
Design your own sig @ myu2sig.com - Gen Status: - Total unique user count:

IchBin

Ok, that's helping. Rewrites are capable of being able to pass the end of the URL (the part after the domain). As long as the old domain is pointing there, Rewrite rules should be able to push the request to whatever the new URL is. Anything that hits index.php from the old URL should be able to be forwarded to the mysite.com/eojmp/index.php. Additional rules should be able to be made to forward anything not hitting index.php to mysite.com/whatever/folder/image.jpg etc.

I can't test things right now because it appears my server is down. I'll have to get back to this later when it comes up.

MoreBloodWine

Quote from: IchBin on February 05, 2011, 02:39:15 AM
Ok, that's helping. Rewrites are capable of being able to pass the end of the URL (the part after the domain). As long as the old domain is pointing there, Rewrite rules should be able to push the request to whatever the new URL is. Anything that hits index.php from the old URL should be able to be forwarded to the mysite.com/eojmp/index.php. Additional rules should be able to be made to forward anything not hitting index.php to mysite.com/whatever/folder/image.jpg etc.

I can't test things right now because it appears my server is down. I'll have to get back to this later when it comes up.
I'm gonna make this easy and work on a list of exclusions / things that should not be touched by forwards since they will need to remain top level and accessable by using eojmarket.com

Edit:
QuoteAdditional rules should be able to be made to forward anything not hitting index.php to mysite.com/whatever/folder/image.jpg etc
The only rule that needs to be made so anything not hitting eojmarket.com is the base URL itself. So eojmarket.com in any of it's three variations http://www.eojmarket.com, www.eojmarket.com & eojmarket.com should be forwarded to http://www.mysite.com

Edit 2: Hopefully these new rewrites / forwards don't mess with existing ones as seen above in another reply.
Download my custom SMF 1.x / 2.x Who.template.php
Get 15% off using coupon code xjz3918744 here where all your video editing needs can be met !
Design your own sig @ myu2sig.com - Gen Status: - Total unique user count:

This website is proudly hosted on Crocweb Cloud Website Hosting.