yup, you can configure it using htaccess or through your 404.php file
Could you tell me what I need to write? I have no clue.
put the following pithy codes into 404.php file of your wp theme:
<?php
header("HTTP/1.1 301 Moved Permanently");
header("Location: ".get_bloginfo('url'));
exit();
?>
if it doesn’t work, please tell me, i’ll give you another solution. thanks you 🙂
Sorry this didn’t work. Thanks though.
didn’t work? the errors?
btw, you can try the example at my weblog by clicking http://aufklarung.org/wp-content/ …
Well, wp-content still showed the files under that directory, but when I typed an invalid URL, the 404 page had an error:
Warning: Cannot modify header information, so I reverted back to my original 404 page.
put Option -Indexes in the .htaccess file in your blog root dir.
Do you put it in like this?
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
Option -Indexes
# END WordPress
or like this:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
Option -Indexes
</IfModule>
# END WordPress
or something else entirely?
So I tried both ways, and I got an Internal Server Error for all pages in my web site.
I still have no luck with this issue. Can anyone help me?
Maybe I wasn’t clear enough on what I am looking for. An example site of this in action would be http://little-wonder.net. Try typing the following extentions after the url to see the results:
wp-config.php
, wp-content
, wp-admin
. You can also try other extensions, even ones you know don’t exist like asdf
.
I came up with a solution, well sort of. What I did was created an index page that had this in it:
<?php
header( 'Location: http://suefeng.com' ) ;
?>
and put that into the folders I don’t want people to view such as wp-content, wp-content/themes, wp-content/plugins, etc. It doesn’t use .htaccess or the 404 page, but it still works.