Welcome to the JaguarPC Community
JaguarPC
Sales: (888) 338-5261
Support: (888)-551-3050
Results 1 to 4 of 4

This is a discussion on subdomains and trailing slashes in the VPS & Dedicated forum
i'm having a problem with my subdomain and trailing slashes. if i enter http://www.domain.com/directory/ it works fine but if i enter http://www.domain.com/directory it gets all ...

  1. #1
    JPC Member
    Join Date
    Oct 2007
    Posts
    6

    subdomains and trailing slashes

    i'm having a problem with my subdomain and trailing slashes.

    if i enter http://www.domain.com/directory/ it works fine

    but if i enter http://www.domain.com/directory it gets all wonky

    i found this article which seems like a fix. http://www.webmasterworld.com/forum92/5035.htm
    but, i don't know where to add the following in my httpd.conf file, and also how to restart apache to see these changes.

    Options -MultiViews
    UseCanonicalName off

    i should also mention that i am a learning newbie. i greatly appreciate any help.

  2. #2
    I didn't do it! Daniel_DBS's Avatar
    Join Date
    Aug 2007
    Location
    Mars
    Posts
    1,204
    Which control panel are you using??? The reason I ask is because the httpd.conf file varies slightly between the control panels...

    I am not sure about the Multiviews one, however, UseCanonicalName is towards the top of my cPanel apache conf file...

    here is an example of my httpd.conf file and where UseCanonicalName is located:


    Code:
    [root@hostname~]# vi /usr/local/apache/conf/httpd.conf
    Include "/usr/local/apache/conf/php.conf"
    Include "/usr/local/apache/conf/modsec.conf"
    
    
    RLimitMEM 2519229781
    RLimitCPU 240
    ServerType standalone
    KeepAlive On
    MaxKeepAliveRequests 100
    KeepAliveTimeout 15
    MinSpareServers 5
    MaxSpareServers 10
    StartServers 5
    MaxClients 150
    MaxRequestsPerChild 0
    Port 80
    AccessFileName .htaccess
    UseCanonicalName On
    DefaultType text/plain
    HostnameLookups Off
    ErrorLog /usr/local/apache/logs/error_log
    LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
    Once you add it to your httpd.conf file, you need to type the following at the command prompt to restart apache:

    Code:
    /etc/init.d/httpd restart
    I hope that helps!

    -Daniel
    Last edited by Daniel_DBS; 01-04-2008 at 02:46 PM. Reason: Marked UseCanonicalName
    -Daniel

    If the automobile had followed the same development cycle as the computer, a Rolls-Royce today would cost $100, get a million miles to the gallon, and explode once every few weeks.

    My scripts never have bugs. They just develop random features.

  3. #3
    JPC Member
    Join Date
    Oct 2007
    Posts
    6
    thanks for the reply. i'm using cpanel. your code is somewhat helpful, but mine doesn't include UseCanonicalName at the beginning, though it appears in several other places. i'm thinking that it belongs within the virtual host listing for the subdomain, maybe like this?

    <VirtualHost ip:80>
    ServerName
    ServerAlias
    ServerAlias
    ServerAdmin
    DocumentRoot

    Options -MultiViews
    UseCanonicalName off

    <IfModule mod_suphp.c>
    </IfModule>
    <IfModule !mod_disable_suexec.c>
    </IfModule>
    BytesLog
    CustomLog
    ScriptAlias
    </VirtualHost>

  4. #4
    I didn't do it! Daniel_DBS's Avatar
    Join Date
    Aug 2007
    Location
    Mars
    Posts
    1,204
    This is how one of my VirtualHost lines looks:

    Code:
    <VirtuartualHost IP:80>
        ServerName domain.com
        ServerAlias www.domain.com
        DocumentRoot /home/user/public_html
        ServerAdmin webmaster@domain.com
        UseCanonicalName Off
        CustomLog /usr/local/apache/domlogs/domain.com combined
        BytesLog /usr/local/apache/domlogs/domain.com-bytes_log
        <IfModule !mod_disable_suexec.c>
            User user
            Group group
        </IfModule>
        <IfModule mod_suphp.c>
            suPHP_UserGroup user group
        </IfModule>
        <IfModule concurrent_php.c>
            php4_admin_value open_basedir "/home/user:/usr/lib/php:/usr/php4/lib/php:/usr/local/lib/php:/usr/local/php4/lib/php:/tmp"
            php5_admin_value open_basedir "/home/user:/usr/lib/php:/usr/local/lib/php:/tmp"
        </IfModule>
        <IfModule !concurrent_php.c>
            <IfModule mod_php4.c>
                php_admin_value open_basedir "/home/user:/usr/lib/php:/usr/php4/lib/php:/usr/local/lib/php:/usr/local/php4/lib/php:/tmp"
            </IfModule>
            <IfModule mod_php5.c>
                php_admin_value open_basedir "/home/user:/usr/lib/php:/usr/local/lib/php:/tmp"
            </IfModule>
        </IfModule>
        ScriptAlias /cgi-bin/ /home/user/public_html/cgi-bin/
    
    
    </VirtualHost>
    I don't have the MultiViews one...
    -Daniel

    If the automobile had followed the same development cycle as the computer, a Rolls-Royce today would cost $100, get a million miles to the gallon, and explode once every few weeks.

    My scripts never have bugs. They just develop random features.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •