Server Fault Asked by cma4 on December 25, 2021
I’m trying to redirect all requests from my website to a subdir but it doesn’t work. This thing is going to make me crazy and any help would be appreciate.
In conclusion, I want this :
to
Here is my rule :
RewriteEngine On
RewriteCond %{REQUEST_URI} !^/mydir/$
RewriteRule ^(.*)$ /mydir/
But it doesn’t work… Apache doesn’t redirect. What am I doing wrong??
Thank you,
Regards.
First make sure .htaccess and mod_rewrite are working. If .htaccess is not enabled, add AllowOverride All to Apache configuration file to enable .htaccess
For redirecting test
RewriteEngine On
RewriteRule ^/?test/(.*)$ /mydir/$1 [R,L]
or for everything
RewriteEngine On
RewriteRule ^(.*)$ /mydir/$1 [R,L]
Answered by Ameer Iqbal on December 25, 2021
Get help from others!
Recent Questions
Recent Answers
© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP