.htaccess not working — CyberPanel - WebHosting Control Panel for OpenLiteSpeed
CyberLoader

.htaccess not working

hi ,
i love "cyberpanel" <3 it's amazing work ;) thank you to keep it for free . my problem with rewrite rules , i followed the instruction here "http://docs.cyberpanel.net/doku.php?id=rewrite-rules" but all time's i get 404 when try access to ->
domain.com/en
domain.com/en/call_us
can you help me please ? :'(
.htaccess file in attachments

Comments

  • @mrjk990 said:
    hi ,
    i love "cyberpanel" <3 it's amazing work ;) thank you to keep it for free . my problem with rewrite rules , i followed the instruction here "http://docs.cyberpanel.net/doku.php?id=rewrite-rules" but all time's i get 404 when try access to ->
    domain.com/en
    domain.com/en/call_us
    can you help me please ? :'(
    .htaccess file in attachments

    Hello @mrjk990

    Thank you for your feedback, we appreciate.

    I've made some adjustments to your rewrite rules, let me know if you still have issues.

    RewriteRule ^([a-z]{2})/?(.)$ index.php/$2?flag=$1 [L,QSA] >> RewriteRule ^/([a-z]{2})/?(.)$ index.php/$2?flag=$1 [L,QSA]

    There is an additional slash.

    For more information about rewrite syntax with Openlitespeed you can read: http://open.litespeedtech.com/mediawiki/index.php/Help:Rewrite_Rule_Differences

    Best Regards

  • hi , thanks for your response ,
    after test .htaccess not working on any site ,
    even if .htaccess file contains an incorrect code!!
    all time get 404 :(
    please help

  • edited October 2017

    Can you please create ticket here.

    I will look into this, please attach necessary login details with your ticket and website address.

    Best Regards.

  • Ticket Created <3 thanks

  • Hello, i got same problem could you check my htaccess and edit it to make it working?

    `
    Options -MultiViews
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule .(js|css|jpeg|jpg|gif|png|ico|map)(\?|$) /404error.php [L,NC]

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    `

    I get this error `404
    Not Found

    The resource requested could not be found on this server!`

  • You can mention below for others to see that how you fixed your problem.

  • # Correcting Error 404 not found #

    * Note:
       it is not necessary to use .htaccess

    Follow the steps below to fix the site access error (404 not found)

    1- Log in to the cyberpanel
        You must log in to the account of the site that you want to correct the error 404 not found

    2- In the left side menu click on "Websites". Now click on "List Websites"

    3- Select the website
        You should select the website by clicking the cyberpanel icon located in Launch (right side of the domain you want to fix the problem).

    4- Accessing domain rules
        Scroll down the page and click "Rewrite Rules" located in the "CONFIGURATIONS" area.

    5 - Rewriting domain rules
         Copy the code below and paste in the Rewrite Rules area, changing "http://www.domain.com" for your domain. Then click the "Save Rewrite Rules" button.

    RewriteEngine On
    RewriteRule RewriteRule ^([a-z]{2})/?(.)$ index.php/$2?flag=$1 [L,QSA] >> RewriteRule ^/([a-z]{2})/?(.)$ index.php/$2?flag=$1 [L,QSA]
    RewriteCond %{SERVER_PORT} 80
    RewriteRule ^(.*)$ http://www.domain.com/$1 [R,L]

    6 - Restart the server
  • 7 - Access your site using www
          example:
          www.domain.com
  • Hi, I have this .htaccess rules in my php script, but its not working. Its used to work in appache server. but its not in openlitespeed. My cyberpanel version is 1.8.



    Options -MultiViews -Indexes


    RewriteEngine On

    # Handle Authorization Header
    RewriteCond %{HTTP:Authorization} .
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

    # Redirect Trailing Slashes If Not A Folder...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_URI} (.+)/$
    RewriteRule ^ %1 [L,R=301]

    # Handle Front Controller...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ index.php [L]



    Someone help me out. Its always giving 404 error. see here at https://adkit.in
  • cotlasweb said:

    Hi, I have this .htaccess rules in my php script, but its not working. Its used to work in appache server. but its not in openlitespeed. My cyberpanel version is 1.8.



    Options -MultiViews -Indexes


    RewriteEngine On

    # Handle Authorization Header
    RewriteCond %{HTTP:Authorization} .
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

    # Redirect Trailing Slashes If Not A Folder...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_URI} (.+)/$
    RewriteRule ^ %1 [L,R=301]

    # Handle Front Controller...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ index.php [L]



    Someone help me out. Its always giving 404 error. see here at https://adkit.in

    That is the main reason I am requesting this https://forums.cyberpanel.net/discussion/1485/apache-as-backend to make sure we don't have any issues with .htaccess after migrating apps to CyberPanel
  • If anyone needs full .htaccess support, that is what LiteSpeed Enterprise is for. You can read more at what is supported and not supported in OpenLiteSpeed here -> https://cyberpanel.net/2018/09/10/openlitespeed-v1-4-38-has-been-released/

    @cotlasweb

    and @Chlitzxer you still have only very few votes.
Sign In or Register to comment.
CyberPanel Discord

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!