problem with .htaccess configuration in cakephp3 - .htaccess

i have a problem since one week about my cakephp3 project. i have developped a cakephp3 project in localhost and it works very fine. in my server i have created a subdomain and i have uploaded my project on it. when i execute my project, i have this error message
Internal Server Error The server encountered an internal error or
misconfiguration and was unable to complete your request.
Please contact the server administrator at
webmaster#collector.oiecameroun.org to inform them of the time this
error occurred, and the actions you performed just before this error.
More information about this error may be available in the server error
log.
Additionally, a 500 Internal Server Error error was encountered while
trying to use an ErrorDocument to handle the request.
i think the problem is in the .htaccess file root but i don't know what is the problem. i need help please. my php version is 7.2
this is my .htaccess file root content:
# Uncomment the following to prevent the httpoxy vulnerability
# See: https://httpoxy.org/
#<IfModule mod_headers.c>
# RequestHeader unset Proxy
#</IfModule>
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^(\.well-known/.*)$ $1 [L]
RewriteRule ^$ webroot/ [L]
RewriteRule (.*) webroot/$1 [L]
</IfModule>

this is the error log file content
[03-Oct-2019 07:43:11 UTC] PHP Fatal error: You must enable the intl
extension to use CakePHP. in
/home/cp1035698p49/public_html/collector/config/requirements.php on
line 31
and this problem was also resolved

Related

Using .htaccess is giving 500 error but working for file

I am not an expert using .htaccess but here is my scenario:
My .htaccess is in the root.
The only content is below.
To access the pdf file is working fine but not when I am trying to access the file with parameters that is going to return data or send data.
I know I am missing something but what?
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^admin$ login.php
RewriteRule ^admin-system/balance/get$ source/Support/Action.php?action=balance-get
RewriteRule ^admin-system/balance/list$ source/Support/Action.php?action=balance-list
RewriteRule ^admin-system/balance/set$ source/Support/Action.php?action=balance-set
# This one is working fine.
RewriteRule ^admin-system/terms$ app/helper/files/term.pdf
Options +Indexes
</IfModule>
HTTP 500 - when talking about htaccess - is a syntax error. IMHO, just remove the following line:
Options +Indexes
It's highly possible, that Options is not allowed there - the apache error log will give you a clue about it.

.htaccess causes Internal Server Error on xampp

I have .htaccess file and i write two command like that:
ReWriteRule ^member/(.*)$ /oz/photos.php?member=$1
ReWriteRule ^(.*)$ /oz/profile.php?username=$1
and this is the fault:
The server encountered an internal error or misconfiguration and was
unable to complete your request.
Please contact the server administrator at postmaster#localhost to
inform them of the time this error occurred, and the actions you
performed just before this error.
More information about this error may be available in the server error
log.
Additionally, a 500 Internal Server Error error was encountered while
trying to use an ErrorDocument to handle the request.
Apache/2.4.29 (Win32) OpenSSL/1.0.2n PHP/5.6.33 Server at localhost
Port 80
Your rule ReWriteRule ^(.*)$ /oz/profile.php?username=$1 is looping the request every time (recursion OR redirect Loop). The all selector in rule is redirecting the redirected request too.
try
ReWriteRule ^member/(.*)$ /oz/photos.php?member=$1
RewriteCond %{REQUEST_URI} !^/oz/.*
ReWriteRule ^(.*)$ /oz/profile.php?username=$1
Go inside your root folder and Delete/Move the.htaccess file from there and bruh! Solved! It's worked for me

Symfony assets in web folder not found by apache

I copied my symfony2 project to shared hosting.
My .htaccess
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /web
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ app.php [QSA,L]
</IfModule>
Now page is loading but no assets(js,css files) are loaded. When I try to open them myhost/assets/css/style.css I receive an error:
ops! An Error Occurred
The server returned a "404 Not Found".
Something is broken. Please let us know what you were doing when this error occurred. We will fix it as soon as possible. Sorry for any inconvenience caused.
All assets located in web/assets folder
Check apache config, or add to .htaccess uncommented last line from this doc:
# By default, Apache does not evaluate symbolic links if you did not enable this
# feature in your server configuration. Uncomment the following line if you
# install assets as symlinks or if you experience problems related to symlinks
# when compiling LESS/Sass/CoffeScript assets.
# Options FollowSymlinks

500 Internal Server Error in my wamp server while trying to Rewrite URL in .htaccess

I'm trying to rewrite my bulky, ugly url to a neat one which is converting "art.php?id=$1" in to "art/1", but I encounter a "500 Internal Server Error" What shall I do? Can you help me pleeeease?
This is the .htaccess code I used:
RewriteEngine On
RewriteRule ^art/([A-Za-z0-9-]+)/?$ art.php?id=$1 [NC,L]
This is the Error I encountered:
Internal Server Error
The server encountered an internal error or misconfiguration and was
unable to complete your request. Please contact the server
administrator, admin#localhost and inform them of the time the error
occurred, and anything you might have done that may have caused the
error. More information about this error may be available in the
server error log.
Thanks!
Supposed everything is in the gallery folder, which itself is located in the www root directory. Then put this .htaccess file into the gallery folder as well
RewriteEngine on
RewriteBase /gallery/
# prevent endless loop
RewriteCond %{ENV:REDIRECT_STATUS} 200
RewriteRule .* - [L]
# serve real content
RewriteRule ^art/([A-Za-z0-9-]+)/?$ art.php?id=$1 [NC,L]
# make pretty URL
RewriteCond %{QUERY_STRING} id=(.+)
RewriteRule ^art.php$ art/%1? [R,NC,L]
Depending on the server you're on, you might want to set the base for rewriting
RewriteEngine On
RewriteBase /art/
RewriteRule ^([A-Za-z0-9-]+)/?$ art.php?id=$1 [NC,L]
that should work just fine

MAMP: File showing in htdocs but not on Index of/ http://localhost:8888/ page?

I have been using MAMP for over a year now and use Codeigniter and usually have no problems setting up a a website. Ive just completed a website and changed the base URL and .htaccess file so it would be hosted correctly. I changed the settings back and this is the problem:
The main file shows in my htdocs folder (with many other websites held locally) but when i load the start page for MAMP and the list appears of the dfile names, they are all there apart from this file! Ive tried to re-name it, checked my config base url and this is all fine.... why would the file not show up?! The other files do and when i click on the links they work fine.
Ive also tried typing the url without the file being there and this is what i get:
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator, you#example.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.
More information about this error may be available in the server error log.
So as you do i checked my error logs and in the apache_error.log this is the message i've received:
[Fri Jan 18 09:37:54 2013] [alert] [client 127.0.0.1] /Applications/MAMP/htdocs/website-name/.htaccess: <IfModule takes one argument, Container for directives based on existance of specified modules
[Fri Jan 18 09:37:55 2013] [alert] [client 127.0.0.1] /Applications/MAMP/htdocs/website-name/.htaccess: <IfModule takes one argument, Container for directives based on existance of specified modules
My .htaccess file is the same as usual...
.htaccess file:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
#Removes access to the system folder by users.
#Additionally this will allow you to create a System.php
#controller, previously this would not have been possible.
#'system' can be replaced if you have renamed your system folder.
RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ /website-name/index.php?/$1 [L]
#Checks to see if the user is attempting to access a valid file,
#such as an image or css document, if this isn't true it sends
#the request to index.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /website-name/index.php?/$1 [L]
</IfModule>
<IfModule !mod_rewrite.c>
ErrorDocument 404 /index.php
</IfModule>
Could this file be corrupt? Or my whole website in this file corrupt?
Be great if i could get some advice as i've never had this problem before
Thanks

Resources