1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Any .htaccess gurus out there?

Discussion in 'General PHP and MySQL Discussions' started by SchmitzIT, Apr 25, 2012.

  1. SchmitzIT

    SchmitzIT Well-Known Member

    We're splitting up some stuff on our VPS and moving it to a new vps. On the odl VPS, we run this package in a sub-folder of the domain (i.e. entropiaplanets.com/wiki).

    The new domain has it as a subdomain (i.e. wiki.entropiaplanets.com). However, we run an add-on that synchronises XenForo and the wiki logins for us, which requires the files to reside in specific folders.

    Hence, the files on the existing VPS are in www.entropiaplanets.com/w, with /w working out to /wiki. How would we be able to set the same up in the new VPS so it would automatically go int o a /w folder on it, while the URL itself would not be altered?


    Files are in wiki.edntropiaplanets.com/w, but the URL shown should just be wiki.entropiaplanets.com?

    Thanks in advance :)
  2. Cool

    Cool Active Member

    if you look at how .htaccess works you´ll realize very fast that is not the way to do it spec. if you own a vps- or root server.
    so better do the settings in the related v-host wich can be done with just normal std. admin knowledge.
    SchmitzIT likes this.
  3. xfrocks

    xfrocks Well-Known Member

    If you own the VPS, you can point the subdomain to whatever directory in the filesystem. That would work best here. If the VPS use Apache, you can use something like this

    <VirtualHost *:80>
    DocumentRoot "/path/to/your/w/directory"
    ServerName wiki.entropiaplanets.com
    Good luck!
    SchmitzIT and CyclingTribe like this.
  4. SchmitzIT

    SchmitzIT Well-Known Member

    Thanks for everyone's help so far. I'm still facing some issues, though :(

    Navigating to wiki.entropiaplanets.com for some odd reason takes me to wiki.entropiaplanets.com/W. Note the capital W.

    The folder the wiki is in is /w

    This is in my vhost.conf:

    Alias / /var/www/vhosts/wiki.entropiaplanets.com/httpdocs/w/
    php_admin_value open_basedir "/"
    And my .htaccess file:

    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /$1 [L]
    Thw uppercase /W seems to be MediaWiki software translating the /w to uppercase, rather than just using /w/index.php to get me to the right page.

    I've been staring at this for hours now, and still haven't figured it out. I tried several options, but really cannot get further.

    Perhaps a new pair of eyes will spot where things go wrong?

    Thanks in advance :) I'll reward whoever gives the final nudge :)
  5. CyclingTribe

    CyclingTribe Well-Known Member

    Try removing the trailing slash from the path in the Alias? So it's ....../w rather than ...../w/
  6. SchmitzIT

    SchmitzIT Well-Known Member

    Thanks for the tip. That brings me to wiki.entropiaplanets.com/w, with that page throwing a 404.
  7. CyclingTribe

    CyclingTribe Well-Known Member

    I'm thinking it might be easier to setup the "wiki" subdomain as a separate "site" rather than alias it - I do this with several subdomains for my web directory and it works very well.

    What web server are you using?
  8. SchmitzIT

    SchmitzIT Well-Known Member

    We're using Apache on CentOS.

    At this moment, I'm ready to try anything, really. I've spent hours trying to use different settings, and am unfortunately none the wiser :(
  9. CyclingTribe

    CyclingTribe Well-Known Member

    Okay, PM me with the Apache .conf for your main site; I think it'll be better if we try to run the wiki subdomain as a separate Apache "site" - so I'll try and help you build the separate conf file for it. (y)

Share This Page