A
A
Angelxalfa2015-01-28 12:29:20
PHP
Angelxalfa, 2015-01-28 12:29:20

Remove folder from URL?

Hello!
I found on the forums that in order to protect against site hacking, you need to install the site in a folder with short names.
The site follows the path
site/wordpress_fdg85j2g8ui8fn/
access in the browser occurs along the path
site.com
Everything is fine, but when opening images, their full path
is written site.com/wordpress_fdg85j2g8ui8fn/wp-content/uploa...
And the whole point of such protection is lost.
If you write in .htaccess to remove part of the URL and get site.com/wp-content/uploads/2013/12/logo2.png
RewriteCond %{REQUEST_URI} ^/wordpress_fdg85j2g8ui8fn
RewriteRule ^wordpress_fdg85j2g8ui8fn(.*)$ site.com/$1 [ R=301,L]
We get the desired URL, but there is no file at this URL, and when accessing it, a 404 error occurs.
Is there any way to fix this?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
M
mr_dev1l, 2015-01-28
@Angelxalfa

It is better to set the rights you need to folders with files, less problems - more results.

K
Kir, 2015-01-28
@angry_bender

I found on the forums that in order to protect against site hacking, you need to install the site in a folder with short names.

"protection by hiding" does not work.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question