Forum Moderators: phranque

Message Too Old, No Replies

Remove subfolder from multiple domain request

         

jw131313

8:59 pm on Apr 4, 2011 (gmt 0)

10+ Year Member



Hello:

First of all, I am not an expert and am new to all of this. I have been running multiple domains from my web server for some time now, using Rewrites in my .htaccess file on the root level. I have three domains separated into three sub-folders. This has been fine until recently.

For one of my domains, I use indexhibit. The site loads and functions successfully, but I don't like how the URLs are being displayed.

I would like them to be like this:
www.domain.com/section/page

They are currently displayed like this:
www.domain.com/subfolder/section/page

"subfolder" = the name of the subfolder the domain's files are saved in...

can anyone provide assistance on how to fix this?

Thanks in advance.

jdMorgan

9:04 pm on Apr 6, 2011 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



First change all of the links on your pages to refer to the URLs you want to use.

Next, change all on-page object includes (all image, css, JS file includes) that use page-relative URLs to use server-relative URLs (starts with a slash) and/or absolute URLs (starts with "http://www.example.com/").

Finally, write three rules that internally rewrite "somedomain-here.com/page-name-here" to the filepath /somedomain-here/page-name-here unless this rewrite has already been done (you must prevent recursion).

There are many threads here on rewriting multiple domains and/or subdomains to subdirectories. A search for "rewrite domain subdirectory" can be further refined by adding code-specific search words like "RewriteCond HTTP_HOST rewriterule."

Jim