0

I would like to be able to view individual files and list of a sub directory by entering in the url. I have around 100 folders with images and I want to be able to click on links and see the images. I previously had this and the developer has done something to stop it!

For example my website is example.com and I have a folder called 2176; I want to be able to enter example.com/2176 and I want to view the list of files and the date the file was modified (if possible).

I have read it is just a change to the .htaccess file. I can post my .htaccess file but Stackoverflow wouldn't allow me to post it as it saw errors.

I tried removing the / after RewriteBase, but that didn't work

# BEGIN WordPress
# The directives (lines) between "BEGIN WordPress" and "END WordPress" are
# dynamically generated, and should only be modified via WordPress filters.
# Any changes to the directives between these markers will be overwritten.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress
Louis
  • 1
  • 1
  • # BEGIN WordPress # The directives (lines) between "BEGIN WordPress" and "END WordPress" are # dynamically generated, and should only be modified via WordPress filters. # Any changes to the directives between these markers will be overwritten. RewriteEngine On RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] # END WordPress – Louis Jul 14 '23 at 10:56
  • 1
    Please [edit your question](https://stackoverflow.com/posts/76687006/edit) to add your (formatted) code. – MrWhite Jul 14 '23 at 11:19
  • 1
    "but Stackoverflow wouldn't allow me to post it as it saw errors" - You need to "format" your code by either intending by 4 spaces (button on the editor toolbar) or use backtick fencing (3 backticks on a line before and after the code block). – MrWhite Jul 14 '23 at 11:22
  • Thanks MrWhite I have inserted the snippet of my htaccess file – Louis Jul 14 '23 at 11:29
  • 1
    Does this answer your question? [How to enable a directory listing in Apache web server](https://stackoverflow.com/questions/39239276/how-to-enable-a-directory-listing-in-apache-web-server) – CBroe Jul 14 '23 at 12:10
  • 1
    What response are you getting when requesting `example.com/2176/` (note there must be a trailing slash if `2176` is a directory). A 403, a 404, a 200 (and perhaps a blank page) or something else? – MrWhite Jul 14 '23 at 12:19
  • 404 Page Not Found We're sorry, but the server could not find the URL you tried to load. – Louis Jul 14 '23 at 12:40
  • Is there another `.htaccess` file in that subdirectory? – MrWhite Jul 14 '23 at 12:41
  • No there is not – Louis Jul 14 '23 at 12:44

0 Answers0