I want to redirect all /wordpress/ requests to the same address at root.
For example:
/wordpress/foo -> /foo
I tried this answer I found by adding it to the .htaccess file:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^wordpress/.*$ / [R=302]
</IfModule>
but needless to say, it just redirects the direct request to /wordpress/ to /.
e.g. a request to /wordpress/foo/ will still be treated as /wordpress/foo/.
I tried everything I found but nothing works.
website address is http://www.ist118.com/
an example address that doesn’t redirect correctly is http://www.ist118.com/wordpress/%D8%A8%D9%87%D8%AA%D8%B1%DB%8C%D9%86-%D8%B1%D8%A7%D9%87%D9%86%D9%85%D8%A7%DB%8C-%D8%AE%D8%B1%DB%8C%D8%AF-%D8%A7%D8%B2-%D8%A7%D8%B3%D8%AA%D8%A7%D9%86%D8%A8%D9%88%D9%84/%D9%82%DB%8C%D9%85%D8%AA-%D8%AE%D9%88%D8%B1%D8%A7%DA%A9%DB%8C-%D9%87%D8%A7-%D8%AF%D8%B1-%D8%A7%D8%B3%D8%AA%D8%A7%D9%86%D8%A8%D9%88%D9%84/
(url is encoded because of utf8 arabic characters)
Complete .htaccess contents:
RewriteOptions inherit
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule /wordpress/(.*) /$1 [PT]
</IfModule>
Try this:
UPDATED
I think your .htaccess should look like this:
UPDATED
Just for your information.
If you need just transparent redirection, you should use
in this case redirect will transparently and user will still see an old URL in browser’s address line
But if you want user to know the URL was changed, you should use
in this case URL will changed in browser’s address line too
And one more: