The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Htaccess problems at ~user path

Discussion in 'General Discussion' started by korex, Jun 16, 2010.

  1. korex

    korex Registered

    Joined:
    Jun 16, 2010
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Hi,

    I would like to reach my website like this: http://domain.com/~user. This works fine, but my our own CMS's url interpreter redirects the page to index.php and the url is processed by the index.php.
    The redirection code form the CMS's htaccess file:
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]

    The CMS's url structure works like this:
    http://domain.hu/contact/ <- this is the contact page

    The problem comes form this structure, because an 'index.html' is put to the end of the url (http://domain.hu/contact/index.html), which file doesn't exists (and I recieve a redirection error screen).
    I couldn't find the redirection, which put's the 'index.html' after the url (httpd.cong negativ, htaccess files negativ). I tried to play with the CMS htaccess file (redirect the url with index.html to non-index.html), but I didn't manage to solve the problem

    I'm out of ideas, neither the system administrator could help me.

    Thank you!
     
  2. eth00

    eth00 Well-Known Member
    PartnerNOC

    Joined:
    Mar 30, 2003
    Messages:
    723
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    NC
    cPanel Access Level:
    Root Administrator
    The easy fix for this is to modify your local computer hosts file to point to the new server IP.
     
  3. cPanelJared

    cPanelJared Technical Analyst
    Staff Member

    Joined:
    Feb 25, 2010
    Messages:
    1,842
    Likes Received:
    18
    Trophy Points:
    38
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    Friendly moderator note

    I moved this thread to a more appropriate category since it does not directly address cPanel-related development issues.
     
  4. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,478
    Likes Received:
    203
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    It seems to me you'd have to get the domain working properly to use shortened URLs as it appears your CMS wants to do, or disable those rules in your CMS htaccess for it, so that your site works as expected.
     
  5. cPanelDavidN

    cPanelDavidN Integration Developer
    Staff Member

    Joined:
    Dec 17, 2009
    Messages:
    571
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    Houston, TX
    cPanel Access Level:
    Root Administrator
    I'd be curious if your index.php is using a location header.

    Hypothesis:
    index.php will retrieve the REQUEST_URI from $_SERVER super global (PHP: $_SERVER - Manual). Then the CMS uses it's own URI parser to determine what page needs to be served, and if necessary, will build the 'proper' URL and push headers with a defined "Location", (PHP: header - Manual)

    If this is true, you could simply modify the CMS's URI parser and make it bend to your will :)
    -DavidN
     
  6. korex

    korex Registered

    Joined:
    Jun 16, 2010
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    1
    Solved

    Hi,

    I finally solved the problem with the modification of the php interpreter (and changing the links on the site). I wanted to avoid this, because I thought maybe there's a simple solution/settings for this.

    Thanks for the replies, and sorry for putting this post at the wrong forum.
     
Loading...

Share This Page