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!

301 Permanent redirects

Discussion in 'General Discussion' started by _Chris_, Jan 31, 2017.

Tags:
  1. _Chris_

    _Chris_ Well-Known Member

    Joined:
    Oct 22, 2007
    Messages:
    64
    Likes Received:
    0
    Trophy Points:
    56
    Hi all, can anyone here please post an example of a complete .htaccess file, including symlinks, the whole page, to include a permanent 301 redirect from example.com/here/index.php to example.com/there/index.php
     
  2. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    16,480
    Likes Received:
    421
    Trophy Points:
    583
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    What problem are you facing? You can create a new htaccess with a 302 redirect simply by logging into your cPanel and adding one:
    cPanel > Domains > Redirects.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. _Chris_

    _Chris_ Well-Known Member

    Joined:
    Oct 22, 2007
    Messages:
    64
    Likes Received:
    0
    Trophy Points:
    56
    Thanks, am looking for an example page, to examine.
     
  4. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    16,480
    Likes Received:
    421
    Trophy Points:
    583
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    Using cPanel to create one is the best way to go.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  5. _Chris_

    _Chris_ Well-Known Member

    Joined:
    Oct 22, 2007
    Messages:
    64
    Likes Received:
    0
    Trophy Points:
    56
    Yep, in some cases, but not in this one.
     
  6. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    16,480
    Likes Received:
    421
    Trophy Points:
    583
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    I'm unclear on your response. What is it you're after that you can't get by creating your own, via cPanel?
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  7. _Chris_

    _Chris_ Well-Known Member

    Joined:
    Oct 22, 2007
    Messages:
    64
    Likes Received:
    0
    Trophy Points:
    56
    Hi Infopro, as mentioned, I'm wanting to view an actual .htaccess file with all of the code included.
     
  8. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    16,480
    Likes Received:
    421
    Trophy Points:
    583
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    What's stopping you from creating one to look at exactly, that's whats confusing to me. I just created this one:
    Code:
    
    RewriteEngine on
    RewriteCond %{HTTP_HOST} ^example.com$ [OR]
    RewriteCond %{HTTP_HOST} ^www.example.com$
    RewriteCond %{REQUEST_URI} !^/[0-9]+..+.cpaneldcv$
    RewriteCond %{REQUEST_URI} !^/[A-F0-9]{32}.txt(?: Comodo DCV)?$
    RewriteRule ^somefilename.php/?(.*)$ "https://example.com/someotherfilename.php$1" [R=01,L]
    
    That server has AutoSSL enabled for this account.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  9. _Chris_

    _Chris_ Well-Known Member

    Joined:
    Oct 22, 2007
    Messages:
    64
    Likes Received:
    0
    Trophy Points:
    56
    Thanks, I was just trying to see a complete .htaccess file, with *all* the relevant code - ie, symlinks coding as well.
     
  10. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    16,480
    Likes Received:
    421
    Trophy Points:
    583
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    Lots of resources on the Web for customizing your htaccess, here's one:
    perishablepress.com/stupid-htaccess-tricks/
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
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