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!

SOLVED URL redirection problem

Discussion in 'General Discussion' started by psytanium, Oct 30, 2018.

  1. psytanium

    psytanium Well-Known Member

    Joined:
    Jun 6, 2014
    Messages:
    146
    Likes Received:
    6
    Trophy Points:
    18
    Location:
    Lebanon
    cPanel Access Level:
    Root Administrator
    Hello,

    Google search engine post results of old URLs of my website, after some readings, Google remove URLs with 404 Not Found from indexing.

    My websites are redirecting all none found links to 404 Not Found unless the link contain index.php

    e.g. www.domain.com/asdasda redirect to 404 Not Found, good

    but

    e.g. www.domain.com/index.php/asdadasd redirect to home page instead - This is a problem, Search engines keeps those wrong URLs as valid.

    All my websites hosted on my VPS server have the same problem.

    Need some help please, I have people who search for product A on Google, end up at home page instead of product page.
     
  2. cPanelMichael

    cPanelMichael Technical Support Community Manager Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    47,005
    Likes Received:
    2,123
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello @psytanium,

    Can you let us know the contents of the .htaccess file in the document root of this website? Ensure to paste the output in CODE tags and replace real domain names with examples.

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. psytanium

    psytanium Well-Known Member

    Joined:
    Jun 6, 2014
    Messages:
    146
    Likes Received:
    6
    Trophy Points:
    18
    Location:
    Lebanon
    cPanel Access Level:
    Root Administrator
    All my websites have the same problem this link, check example.com/index.php please, this account dont have any .htaccess file, try this link example.com/index.php/test, it should result a 404 Not found, right ?

    Thanks :)
     
    #3 psytanium, Oct 30, 2018
    Last edited by a moderator: Oct 30, 2018
  4. cPanelMichael

    cPanelMichael Technical Support Community Manager Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    47,005
    Likes Received:
    2,123
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello @psytanium,

    I'm not able to reproduce this behavior using the default Apache configuration on a test system. Can you open a support ticket so we can take a closer look at the server and see how Apache is configured? You can post the ticket number here and we will update this thread with the outcome.

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. psytanium

    psytanium Well-Known Member

    Joined:
    Jun 6, 2014
    Messages:
    146
    Likes Received:
    6
    Trophy Points:
    18
    Location:
    Lebanon
    cPanel Access Level:
    Root Administrator
    Support Request ID is: 10606215
     
    cPanelMichael likes this.
  6. psytanium

    psytanium Well-Known Member

    Joined:
    Jun 6, 2014
    Messages:
    146
    Likes Received:
    6
    Trophy Points:
    18
    Location:
    Lebanon
    cPanel Access Level:
    Root Administrator
    Support ticket conclusion:

    "it appears your issue is specific to how PHP query strings are handled.

    When loading a PHP file through the Apache service, any characters after the file are handled as query strings. This is the default behavior in the Apache service and allows for PHP query string support."

    So any server running Apache, have the same behavior.
     
  7. cPanelMichael

    cPanelMichael Technical Support Community Manager Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    47,005
    Likes Received:
    2,123
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  8. psytanium

    psytanium Well-Known Member

    Joined:
    Jun 6, 2014
    Messages:
    146
    Likes Received:
    6
    Trophy Points:
    18
    Location:
    Lebanon
    cPanel Access Level:
    Root Administrator
    this htaccess helped redirect my URLs properly, if someone have this situation:

    Code:
    RewriteEngine On
    RewriteRule ^index\.php/(.*)$ http://%{HTTP_HOST}/$1 [R=301,L]
     
    cPanelMichael likes this.
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