Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

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:
    51
    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:
    168
    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.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. cPanelJared

    cPanelJared Technical Analyst

    Joined:
    Feb 25, 2010
    Messages:
    1,835
    Likes Received:
    20
    Trophy Points:
    143
    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.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  4. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    16,309
    Likes Received:
    393
    Trophy Points:
    583
    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.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. cPanelDavidN

    cPanelDavidN Integration Developer

    Joined:
    Dec 17, 2009
    Messages:
    571
    Likes Received:
    3
    Trophy Points:
    68
    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
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  6. korex

    korex Registered

    Joined:
    Jun 16, 2010
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    51
    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

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice