Proper url in address bar - apache

I have got a site running on apache. Now I have a domain. Lets say: [www.mysite.com][1]. When I enter this it goes to for example to [www.sites/sitedirectory][2] this I see in the address bar.
How can I make sure (i think it shoult be done with .htaccess) that it will still show in my address bar [www.mysite.com][3] and not [www.sites/sitedirectory][4]
Thanks very much.

You cannot make a browser's address bar show a domain different from where the data was loaded from, for security reasons.
There are a few options:
You can set up www.mysite.com to be a proxy, which fetches content from www.sites/sitedirectory, and re-serves it, but I suspect that isn't really what you want.
You can put a web page at wwww.mysite.com which consists of one large HTML frame containing the real site at www.sites/sitedirectory. This is widely considered to be a bad idea, as (without a lot of messing about) it means that you can only ever link to the home page, and links to other sites have to be specially written to jump out of the frameset, etc, etc.
You can sort out your Apache configuration so that there is a proper vhost entry for www.mysite.com, rather than a redirect to the other URL.
Without knowing why you have got to where you are, I would strongly suggest investigating option 3.

Related

How to properly use a CDN?

Good evening everyone! Thank you for opening this post.
I currently bought myself the ProCDN from MediaTemple (basically EdgeCast) and have setup a CDN where now I go to cdn-small.DOMAIN.com (or cdn-large.DOMAIN.com) it loads the normal website just fine...
However, I'm not sure which one to use.. Would I use this for the whole complete site to optimize, or use the links to add one by one for each script/stylesheet based on file size? (e.g. All JS/CSS will have the cdn-small while anything larger such as 300kb will have the cdn-large link)
And to say, if the correct way is to load the whole site as one link (e.g. everything is linked normally like js/jquery.js instead of a full link like https://cdn-small.domain.com/js/jquery.js).. Would I set a redirect from DOMAIN.com to cdn-small.DOMAIN.com for the best loading and that they only need to type in the domain not the full sub-CDN-domain?
Apologize if this isn't making sense or anything, but trying to do my best. To put it much more simple terms again is that I'm trying to find the best way to use my cdn-small/cdn-large for my website by having the user enter in the domain (https:// or http://) normally to serve my content as fast as possible near the user.
Kindly appreciate your time for reading this and wish you all a positive weekend.
Here is my live site if it even matters or want to experiement; http://bit.ly/1eGCShX

How to direct multiple clean URL paths to a single page?

(Hi! This is my first time asking a question on Stack Overflow after years of finding answers here... Thanks!)
I have a dynamic page, and I'd like to have fixed URLs that point to different states of that page. So, for example: "www.mypage.co"(/index.php) is the base page, and it rearranges its content based on user choices. I'd then like to be able to point to "www.mypage.co/contentA" or "www.mypage.co/contentB" in order to automatically load base the page at "www.mypage.co" with the desired content.
At heart the problem is an aesthetic one. I know I could simply write www.mypage.co/index.html?state=contentA to reach the desired end, but I want to keep the URL simple and readable (ie, clean). I also, due to limitations in my hosting relationship, would most appreciate a solution that is server-independent (across LAM[PHP] stacks, at least), if possible.
Also, if I just have incorrect assumptions about how to implement clean URLs, I'd appreciate direction to a good, comprehensive explanation. I can't seem to find one...
You could use a htaccess file to redirect all requests to one location and then from there determine what you want to return to the client. Look over the htaccess/dispatch system that Tonic uses.
If you use Apache, you can use mod_rewrite. I have a rule like this where multiple restful urls all go to the same page, using regex and moving parts of the old url into parameters for the new url:
RewriteRule ^/testapp/(name|number|rn|sid|unii|inchikey|formula)(/(startswith))?/?(.*) /testapp/ProxyServlet?objectHandle=Search&actionHandle=drillIn&searchtype=$1&searchterm=$4&startswith=$3 [NC,PT]
That particular regex accepts urls like
testapp/name
testapp/name/zuchini
testapp/name/startswith/zuchini
and forwards them to the same page.
I also use UrlRewriteFilter for Tomcat, but as you mentioned PHP, that doesn't seem that it would be useful.

Planning url rewrite for my web app

I'm working on a site which shows different products for different countries. The current url scheme I'm using is "index.php?country=US" for the main page, and "product.php?country=US&id=1234" to show a product from an specific country.
I'm planning now to implement url rewrite to use cleaner urls. The idea would be using each country as subdomain, and product id as a page. Something like this:
us.example.com/1234 -> product.php?country=US&id=1234
I have full control of my dns records and web server, and currently have set a * A record to point to my IP in order to receive *.example.com requests. This seems to work ok.
Now my question is what other things I'd need to take care of. Is it right to assume that just adding a .htaccess would be enough to handle all requests? Do I need to add VirtualHost to each subdomain I use as well? Would anything else be needed or avoided as well?
I'm basically trying to figure out what the simplest and correct way of designing this would be best.
The data you need to process the country is already in the request URL (from the hostname). Moving this to a GET variable introduces additional complications (how do you deal with POSTs).
You don't need seperate vhosts unless the domains have different SSL certs.

stacks of domains, positive SEO?

I have a client who has brought a truck load of domains he wants me to redirect to his site.
A few of them are the same name with different top level domains (mysite.com, mysite.co.uk etc etc) but a lot of them are keyword related (mylocation-businessType.com etc etc).
I am wondering if either of these will be negative for SEO. I am thinking the top level domain changes will be fine, and expected by google, but the keywords might be views as a bit hacky?
What are the good people of stackoverflow's view on this?
If they are redirected properly then they'll have no effect at all. The only advantage will be if the name makes sense and a user might type it in. eg. identical names with and without hyphens.
For this situation all of the other answers are correct, you won't get any benefits in Pagerank, etc. and it wouldn't be useful except to pickup direct traffic to your domain names that you are then redirecting.
How would it affect your SEO though? That's a little trickier. Two ways of looking at it:
1.) Competitors could do this to you and it'd be completely out of your control. If redirecting a bunch of domains did any real harm to rankings it'd be a great way to do negative SEO, or "Google Bowling," and could be used to take down a site's rankings. That isn't the case though, so it probably wouldn't have too much of a negative effect.
UNLESS
2.) The nameservers for your redirected domains match the nameservers for your main domain. Pointing all domains to the same set of nameservers will help show that all domains are under the control of the same webmaster.
Even if you are using different nameservers and using 301 redirects as recommended, if the server with your redirects comes back to (at least) the same Class C IP address as your main site's server, a search engine would still be able to tie you together as likely being run by the same owner.
Either of these setups can identify you as the source of the redirects and devalue the ranking ability of your main site since there is a much higher likelihood the redirects are coming from you.
winwaed is correct. If you're doing a proper 301 redirect, the other domains are only valuable if people directly type them in. They won't rank, won't get any link juice, and won't get any inbound links. If you do seed inbound links, google will treat them as if they point to the target of your 301 redirect. It's a waste of time to just directly do that for SEO purposes.
The way to use each of those domains for SEO would be to build a bit of unique content on each one, get some inbound links, and then link out to your target page. Not really worth doing unless you really spend a lot of time at it, and google still tends to penalize obvious gaming of the system like that.
They won't contribute toward ranking, however keyword domains do get some amount of advantage for those terms. So, the way to use them is to build sites on all of them and funnel traffic to the main site.
Of course, they can also be used for extra backlinks, but you really want different C class IP addresses from the servers. For that reason you might want to go with SEO hosting.
Matt Cutts from Google explained it in this video:
http://www.youtube.com/watch?v=r1lVPrYoBkA
and here:
http://www.youtube.com/watch?v=a70ygsHgvMw
He also said if he was doing this, he would redirect each of sites to the target sites' different important pages. If the redirected domains had pageranks before, they will still flow pagerank (not exactly but a lower pagerank).

SEO Question, and about Server.Transfer (Asp.net)

So, we're trying to up our application in the rankings in the search engines, and one way our SEO guy told us to do that was to register similar domains...for example we have something like
http://www.myapplication.com/parks.html
so..we acquired the domain parks.com (again just an example).
Now when people go to http://www.parks.com ...we want it to display the content of http://www.myapplication.com/parks.html.
I could just put a forwarding page there, but from what i've been told that makes us look bad because it's technically a permanent redirect..and we're trying to get higher in the search engine rankings, not lower.
Is this a situation where we would use the Server.Transfer method of ASP.net?
How are situations like this handled, because I've defiantly seen this done by many websites.
We also don't want to cheat the system, we are showing relevant content and not spam or tricking customers in anyway, so the proper way to do achieve what i'm looking for would be great.
Thanks
Use your "similar" domain names to host individual and targetted landing pages that will point to your master content.
It's easier to manage and you will get a higher conversion rate.
Having to create individual page will force you to write relevent content and will increase the popularity of the page.
I also suggest you to not only build landing pages, but mini sites (of few pages).
SEO is sa very high demanding task.
Regarding technical aspects: Server.Transfer is what you should use. Never use Response.Redirect, Google and other search engines will drop your ranking.
I used permanent URL rewrite in the past. I changed my website and since lots of traffic was coming from others website linking mine, I wanted to have a permanent solution.
Read more about URL rewriting : http://msdn.microsoft.com/en-us/library/ms972974.aspx