Where to place the robots.txt file in codeigniter.
I dont no how to put where folder.
User-agent: *
Disallow: /
The robots.txt file MUST be placed in the document root of the host. It will not work in other locations.
If your host is example.com, it needs to be accessible at http://example.com/robots.txt.
Related
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.
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.
What is the code used in .htaccess to prevent access of other files in my public folder ( LARAVEL project under shared hosting )?
I have a file called index.php and I want this file to be the only file able to access all the other files/directories.
I have seen other solutions here on StackOverFlow but they do not match above requirement.
Laravel has it's own .htaccess ready and that should work with your shared hosting too..
myfoldersite/public/.htaccess
move to
myfoldersite/.htaccess
and rename
myfoldersite/server.php
to
index.php
And try browsing your site again, let's see if that works.
Cheers!
You can block an access to a folder with this code in the .htaccess
<Directory "/file/">
deny from all
</Directory>
You have to modify the "file" by the name of your files.
But I do not know if that's what you're looking for so you can do this too:
RewriteEngine on
RewriteRule ^(.+)$ index.php
I have a GoDaddy web hosting account with a cPanel access. I am trying to figure out where should i upload my php files.
I have created a new folder inside the public_html folder as fortnox_invoicing and have copied all the code (PHP/HTML/JS) files in that folder.
But when i try to browse the php files it doesn't work instead i get "ops, this page does not exist" message.
http://example.com/fortnox_invoicing/index.php
Following is how the public_html directory looks like for now:
You can upload your PHP files in public_html if you want to browse your website like:
http://example.com
You can also upload PHP files in subfolder if you wish to browse it like
http://example.com/subfolder
If you are receiving error 404 while browsing subfolder, locate .htaccess file and check if there is any rules that are restricting index.php to load and causing 404 page. If .htaccess file is hidden, you'll have to enable the show hidden file in while opening cPanel File Manager. Try renaming .htaccess file and load your website again. Also make sure that root folder contains index page and it is listed as default page in .htaccess file.
You see this page because your website doesn't have "index.php" or "index.html" file in public_html folder.
for example
-public_html
-index.php
**-subfolder**
-aboutus.php
-contact.php
-service.php
**-subfolder**
-thankyou.php
Most service providers use the above hierarchy.
In Setting up offline viewing using the cache manifest from Lynda.com, the author states that IF I'M USING AN APACHE SERVER, then I need to put my cache.manifest file in a subfolder with an .htaccess file so that the cache.manifest file isn't cached itself.
Q: If I'm not using Apache, but IIS instead, then is there an equivalent file, or maybe there's no need for an .htaccess file to ensure that my cache.manifest file is not being cached.
web.config is the IIS version of .htaccess.
Here's a doc on some of .htaccess conversions: http://learn.iis.net/page.aspx/557/translate-htaccess-content-to-iis-webconfig/
Edit: there's also this: http://www.helicontech.com/ape/