Dynadot — .com Registration $8.99

Subdomain redirect need help

Spaceship Spaceship
Watch

tech4

Established Member
Impact
160
I have a programmer not able to do the work.

If someone can point to the right direction. I have a site which creates profiles for restaurants.
Each profile is like mysite/restaurant/location/id.com

Now I want something simple like restaurant.mysite.com will redirect to the profile mysite/restaurant/location/id.com

In short the URL is very long and not pleasant to remember, so I want users to type in restaurant.mysite.com and it will go to the long url.

Can someone with knowledge on this share how this is done so I can give the info to my programmer who is stuck.

Thank you.
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
Unstoppable DomainsUnstoppable Domains
When you deal with redirects like that, you get into pain in the rear duplicate content issues with Google and nobody wants that. Perhaps you are making it too complicated. Remember that the simple solution often is the best... especially in SEO and coding. What if you just give each profile it's own subdomain. Back when I ran my blog hosting, well before Google bought blogger, I did this and it worked great. My main domain was getting backlinks from the subdomains and the subdomains had great rankings.

For example, instead of http://domain.com/users/profiles/bob

you have: http://bob.domain.com ?

This can be done via mod_rewrite and a wildcard DNS entry. *Which I can do, FYI. It requires a dedicated ip address, however.
 
Last edited:
0
•••
Thank you. I got that respond from digitalalpoint about the wildcard. The programmers took days and is having problems. Is it really hard to impliment?because it took the guy 2 days and couldn't solve it.

Is there a way to know if my host has a dedicated ip for my domain name?

Thanks again.

---------- Post added at 08:56 PM ---------- Previous post was at 08:46 PM ----------

Thanks for the advice, I think you are right, making it simple is better.
 
0
•••
You are unlikely to have a dedicated IP address unless you've asked for one. The best way to find out is to ask your web host.

You don't need a dedicated IP address to use wildcard DNS since Apache supports wildcard ServerAlias settings. Your web host may be willing to set this up for you.
 
0
•••
Last edited:
0
•••
Question my domain name server is set up to a number primary and secondary like

1.2.3.4 for primary
2.3.4.5 for secondary

where do Iadd the *.domain.com to my dns? Or are you talking about the control panel of the hosting site, this is confusing) My domain is register at domain monster I change the DNS there. But the control panel in the hosting site not touch yet really and is confusing. Please clarify.

----------------
Now if I decided not to do a redirect, just to make the profile write profile.site.com
Do I still need to do that dns change ?

(just to make sure)

Thank you.
 
0
•••
Take a look at this page:

Domain Name System - Wikipedia, the free encyclopedia

The following is a simplified explanation. In your domain monster control panel you are setting the address of the servers that knows the DNS entries for your domain. These are the "nameservers" for your domain. The nameservers know how to resolve your domain to IP addresses (e.g. they know that www.yourdomain.com resolves to IP address a.b.c.d). Your nameservers are often hosted on the same machine that serves your web pages (ideally not, but many hosts set it up that way).

Currently your nameservers resolve some subdomains of your domain to your web hosting IP address (e.g. www.yourdomain.com). What you need to do is to add a wildcard DNS entry to resolve ANY subdomain to the same IP address. That way if someone types anything.yourdomain.com into their browser it will resolve to your hosting IP address. You can then use mod_rewrite to rewrite the URL to the content you want to display.

You probably need to ask your web host (or whoever gave you the nameserver settings for your domain) to create the wildcard DNS entry for you.
 
0
•••
Thanks for the info, I might just stick to site.com/profile instead of profile.site.com (although the profile.site.com is more interesting but requires more work and the guy I am working with seems to be a complete slow...drag).
 
0
•••
Dynadot — .com Registration $8.99Dynadot — .com Registration $8.99
Appraise.net

We're social

Unstoppable Domains
Domain Recover
DomainEasy — Zero Commission
  • The sidebar remains visible by scrolling at a speed relative to the page’s height.
Back