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.

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:
    15,629
    Likes Received:
    296
    Trophy Points:
    433
    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.
     
  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:
    15,629
    Likes Received:
    296
    Trophy Points:
    433
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    Using cPanel to create one is the best way to go.
     
  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:
    15,629
    Likes Received:
    296
    Trophy Points:
    433
    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?
     
  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:
    15,629
    Likes Received:
    296
    Trophy Points:
    433
    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.
     
  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:
    15,629
    Likes Received:
    296
    Trophy Points:
    433
    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/
     
Loading...

Share This Page