English 中文(简体)
Domains & Foreward Slash
原标题:

This is rather difficult to explain so please bear with me.

We will be hosting 4 websites on our server and the plan is to have each site sit under its own domain:

  • site-a.com
  • site-b.com
  • sub1.site-b.com
  • sub2.site-b.com

Notice the two sub domains!

However, our client has asked if we can implement the following url structure instead of using subdomains:

  • sub1.site-b.com BECOMES site-b.com/sub1/
  • sub2.site-b.com BECOMES site-b.com/sub2/

Does this make sense so far??? So we are using forward slash as opposed to sub domains.

Can you advise on the best way to achieve this please?

Thanks for any help!

Dave.

问题回答

Use Apache to remap the domains. It s probably your webserver, so it s probably the answer.

The docs are here:

http://httpd.apache.org/docs/1.3/mod/mod_alias.html#redirect

Match your subdomain and redirect to the appropriate folder, copying and carrying over the query string as appropriate.

JQuery probably won t help you.

This will depend on your hosting situation.

In IIS you can setup virtual directories for this type of behaviour.

You could also use JavaScript or server side redirects in sub1, sub2 etc folders.





相关问题
URL rewrite in IIS6 - Third party tools

I have collected the following api/sdk/whatever which provide modules for doing url rewriting in IIS 5/6/7. Some are free-open source and some require $. I haven t tried any of them. I would like to ...

Rewrite spring-security redirect URLs

I m trying to get Tuckey UrlRewriteFilter to tidy up URLs for my webapp. One problem I ve got is that when spring-security notices that an anonymous user is trying to access a protected resource it ...

ASP.NET Friendly URLs

In my research, I found 2 ways to do them. Both required modifications to the Application_BeginRequest procedure in the Global.Asax, where you would run your code to do the actual URL mapping (mine ...

Could I get by HttpModule the URL that contains * before?

My web-site is working under ASP.NET 3.5, IIS7, Integrated pipiline mode. My HttpModule is getting request to all resources, including URLs like this: http://my-site.com/address And I would support *...

Domains & Foreward Slash

This is rather difficult to explain so please bear with me. We will be hosting 4 websites on our server and the plan is to have each site sit under its own domain: site-a.com site-b.com sub1.site-b....

URL Mod-Rewrite

I currently have a working URL: http://example.com/security-services.php?service=fixed-camera-surveillance and then I have PHP say, $_REQUEST[ service ] to do some stuff... But I d like to ...

热门标签