How to up to parent folder for my htaccess below:
The htaccess file is on folder include. Structure:
-parentfolder
404.html
-include
.htaccess
Here is my .htaccess file
Deny from all
ErrorDocument 403 /parentfolder/403
Now I want it to up to parent folder:
/../parentfolder/403
But still not working.
Anyone have an idea?
The .htacces must be in parentfolder
Related
How redirect everything inside rootfolder to 404, except files in root/public folder? Directory listing must be disabled everywhere and .htaccessredirected to 404 as well. It's possible to make that with one .htaccess file?
Currently i have Redirect 404 / in root, but when trying to access .htaccess, it's forbidden. Thanks
To redirect everything inside rootfolder to 404, except files in root/public folder ,you can use the following Rule in your /root/.htaccess .
RewriteEngine on
RewriteRule !public - [R=404,L]
and to disable directory listing for all folder/subfolders, add this line to your /root/.htaccess
Options -Indexes
I want to allow directory listing in all sub folders inside folder root, but the root folder should not be able to be directory listed. but i wish to do this with just 1 htaccess file in the root folder, not having to place a Options +Indexes htaccess file in each sub folder.. is this possible?
The best solution for this is to create an index file in the root folder. If you do not have an index file, you can use mod-rewrite, the following rule in your htaccess to deny directory listing for the root.
RewriteEngine on
RewriteRule ^$ - [R=403,L]
Hello i have static html site in the root folder ex: www.example.com . and WordPress site in sub-folder ex: www.example.com/blog so where to put htaccess file in root or subfolder. and how to configure single htaccess file to work for both site.
It depends on what you have in this htaccess file. If it's the Wordpress file, put it in the subfolder.
Anyway, you can have an htaccess file in both directory, the one in the subfolder will ovveride any file in parents directories.
I useing Magmi to import/export products, but when I visit my Magmi subfolder (www.mysite.com/magmi/web/magmi.php) is allways redirect me to my homepage. If I rename - delete - move - turn off the magento main folder .htaccess file I can access to my Magmi subfolder. Can somebody help me please how I can visit the Magmi subfolder without turning of the main .htaccess file?
Inside your Magento's .htaccess just after RewriteBase line add this rule:
RewriteRule ^magmi/ - [L,NC]
This will skip Magento's rewrite handling for /magmi/ URIs.
Add this to your .htaccess file in the magmi folder:
ErrorDocument 401 "Unauthorized Access"
This way, the browser will ask for a user/password, instead of 404'ing.
(See https://serverfault.com/questions/55323/disable-mod-rewrite-for-subdirectory)
in my case, the magmi folder had the wrong permissions. Try setting 755 permission on magmi folder and subfolders
I have a htaccess file in a sub folder like so:
/subfolder/.htaccess
In the htaccess file the following code to set a 404 ErrorDocument
ErrorDocument 404 /404.php
The issue is the 404 page in the root directory is loaded rather than the one in the /subfolder/ folder. I can't simply change the htaccess file to use /subfolder/404.php because the system is going to be installed in lots of different places.
Is there a way to reference the files in the directory that the htaccess is in?
I just had the same problem and found you page...If you have domain/folder and want to redirect anything from the folder back to the domain's index, use ErrorDocument 404 /
...I'm not sure if this goes to the root folder or one folder up, but in your case (and mine) they are one in the same.
Hope this helps!