How to access the subfolder file inside joomla directory? - joomla

I have joomla directory which i have subfolder name membership and a file. I need to access the membership folder through browser url but accessing i am getting 500 internal server error problem. how to avoid it.
for example:
https://example.com // joomla directory with htaccess
https://example.com/membersip/file.php
Output: 500 internal server error

Normally you should be able to access this without issues. But there might be other restrictions in your .htaccess-file.
In my htaccess-file, the following line in the rewrite conditions allows direct access to folders:
# and the requested path and file doesn't directly match a physical folder
RewriteCond %{REQUEST_FILENAME} !-d
Investigate the .htaccess - file in your www-folder to make sure it does not block direct access to subfolders.
Otherwise: the 500 internal server error should leave some error message in the server logs.

Related

Public url issue in aws in laravel

I have hosted my site on aws through ftp,
now when i access this
url : http://X.XXX.XXX.X/projectfoldername/
i can access the page after i use
http://X.XXX.XXX.X/projectfoldername/public
but i want to remove public changed htaccess file also but when i upload it on cpanel it is working.
.htaccess file :
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_URI} !^/public/
RewriteRule ^(.*)$ /public/$1 [L,QSA]
</IfModule>
Any help is highly appreciated
Nearly all Linux OS's have a .conf file that you can use to tell it which folder is the public folder. This needs to be updated for Laravel to work.
From here (https://bobcares.com/blog/cpanel-change-root-directory/), for cPanel:
4. Updating cPanel files
cPanel/WHM does not have an option to change the document root of the main domain via any interface. By default it is the public_html folder in the user home directory.
In certain rare scenarios, we have customers who want their document root to be changed to another folder than public_html.
This has to be done from the backend by updating the cPanel user account file at /var/cpanel/userdata/username/domainname .
The following parameters are updated with the desired directories.
documentroot: /home/steinknu/public_html
scriptalias:
-
path: /home/steinknu/public_html/cgi-bin/
For sites with SSL installed, the configuration file for SSL is also updated accordingly.
This file is available at the location /var/cpanel/userdata/username/domain_SSL .
After making the changes, the user data cache is updated and Apache configuration file is rebuilt to reflect the changes in the corresponding files.
The Apache and PHP-FPM services are restarted and we verify the relevant configuration files to ensure that they are all updated properly.

Cant' access laravel public folder on shared hosting

I recently installed a Laravel app on an OVH shared hosting (pro so I have ssh access). This is my installation structure :
user
app
public
www
Site access is under 'www' so I created a symbolic link there:
ln -s /home/user/app/public /home/user/www/index.html
The symlink is working and pointing to the laravel public folder when I check in Filezilla.
However when trying to access the site I am getting a 403 Forbidden You don't have permission to access this resource.
What am I doing wrong here ?
your symbolic link is problem... you are pointing to index.html instead of index.php
try this:
ln -s /home/user/app/public /home/user/www/index.php
and Create and put this .htaccess file in your laravel installation(root) folder.
<IfModule mod_rewrite.c>
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{REQUEST_URI} !^public
RewriteRule ^(.*)$ public/$1 [L]
</IfModule>
I couldn’t get this to work, it is not a laravel related problem by the way, I assume ovh doesn’t allow symlinks to a protected folder on shared servers. A shame really but I ended up installing laravel in the www folder and preventing access to root with an .htaccess
You can define a multisite with app/public as root folder. Also, I wouldn't have a link to a file like index.html, but either to a folder like ../app/public, e.g. to ensure __DIR__ works correctly in php. (By the way, Laravel does not have an index.html).
I had a similar issue on an OVH shared server: 403 forbidden, You don’t have permission to access this resource when accessing files in Laravel's public storage.
Tweaking .htaccess to allow from all or filesystem access control permissions to 777 rwxrwxrwx had no effect.
For me, the solution was to replace the absolute link /home/accountname/www/***/storage/app/public created by php artisan storage:link by the relative link ../storage/app/public

Configuring CakePHP .htaccess for Cpanel ~temp/ URL

I'm trying to set up CakePHP 2.x in Cpanel (Hostmonster) while the domain of the site is still pointing to the older server. In order to pull up the site without the domain (for demo), I have to use http://[hosting-IP-address]/~mysite.
This is my default .htaccess file located in the root (the one before app/ folder):
RewriteEngine on
RewriteRule ^$ app/webroot/ [L]
RewriteRule (.*) app/webroot/$1 [L]
If I leave it as it is, I get 404 error. When I remove the .htaccess file or leave it blank, the site content loads, but without CSS. The site files are located in /home2/mysite/public_html/ folder. I tried adding RewriteBase with different combinations (~mysite, mysite, mysite/public_html), but no avail.
I have tried with rewrite base setting then i get 500 internal server error. Please suggest
Instead of changing your site .htaccess code. I will suggest you update your local pc host file to point your site to new server, so that you can check your all URL.
Open your hosts file which is located at : c:\Windows\System32\Drivers\etc\hosts and add the following code with your new hosting IP address
hosting-IP-address www.domain.com
hosting-IP-address domain.com

Secure laravel hosting in shared hosting with ssh access

I have access to bluehost unlimited hosting, with many domains on it, including my own.
I have SSH access.
I have deployed a laravel web app by putting the app, bootstrap and vendor folders in a folder outside the main public_html directory, and laravel's public folder contents in my domain folder, adjusted the include routes, and it's working fine.
1) Now, I would like to have all laravel related files in my domain folder but don't know how to make it secure, i.e. pointing the domain to a laravel's public folder inside my domain folder, instead of root of my domain folder, thus preventing public access to app, bootstrap and vendor folders.
I'm not sure if I explained it clearly, this is what I'm trying to achieve:
public_html/
some_domain_folder/
my_domain_folder/
app/
bootstrap/
public/
vendor/
and for my domain to point to my_domain_folder/public so the rest of laravel's files are inaccessible to public.
How can I do that?
2) If I succeed in doing 1) would I be able to execute php artisan commands via SSH?
Thanks,
Petar
Point your domain to the domain folder as normal. Then you can use a .htaccess file inside of my_domain_folder to re-write requests to /public
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REQUEST_URI} !^public
RewriteRule ^(.*)$ public/$1 [L]
</IfModule>
You should be able to run php artisan commands via SSH that bluehost gives you just fine, .htaccess only affects people accessing your site via their browser, not via the command line.

facing error when installing magento on go daddy

hosting magento with godaddy getting error
I have changed my .htacces and php5.ini file ...
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator and inform them of the time the error occurred, and the actions you performed just before this error.
More information about this error may be available in the server error log.
I will thankful to you.
I just finished a magento installation on a godaddy virtualhost and ran up with the same problem.
The fix was to do the following:
In godaddy host administration panel adjust the php version to match that of your magento installation(in my case magento 1.9.1.0 CE -community edition), I've changed it to 5.4.
Then on your .htaccess file of your magento's base directory change the rewrite base directive to point to the relative path like this:
RewriteBase /
On this same file, add at the end of it the following:
RewriteRule ^index.php/(.*)$ [L]
Add the following directives to the php5.ini file at the root of your godaddy's virtualhost(if it doesn't exist create one with the same exact name specified):
[sourcecode language="php"]
register_globals = on
allow_url_fopen = on
cgi.fix_pathinfo =1
[/sourcecode]
And that's it(don't forget to save all file changes and close the files used.
For a full explanation and more detailed steps go to the following article.
The article
Check if your server configuration is compatible for Magento installation first:
Click here for Server Compatibility check
Also make sure the file permissio are correctly given.
Change the folder permission of below folder to 777
app/etc
var
media
Change the file permission of below files to 644
index.php (main index file in magento root folder)
downloader/index.php ( otherwise if you will try to access System > Magento Connect >Magento Connect Manager (after magento installation) by logging to magento admin, you will get 500 Internal Server Error.)
Click here to know the file permission settings.

Resources