CyberPanel Community

.htaccess not working

13 replies
Ho
Hope #2

@mrjk990 said:
hi ,
i love “cyberpanel” <3 it’s amazing work :wink: 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 ? :cry:
.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

mr
mrjk990 #3

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 :frowning:
please help

Ho
Hope #4

Can you please create ticket here.

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

Best Regards.

mr
mrjk990 #5

Ticket Created <3 thanks

Ja
Jack #6

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!`

Ja
Jack #7

Fixed

Ho
Hope #8

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

Pe
Peres #9

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
co
cotlasweb #11

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

Ch
Chlitzxer #12
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

Sign in to reply