Reputation: 7126
Recently I moved my site to Amazon EC2 instance. I want to redirect requests for
http://www.domain.com/data/
to
http://www.domain.com
so any previous paths in the old website like
http://www.domain.com/data/kjk/sds/sds/index.html
should become http://www.domain.com/kjk/sds/sds/index.html
I have tried a couple of mod_rewrite rules using htaccess
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
RewriteRule ^data/. / [R=301,L]
</IfModule>
Any ideas?
Upvotes: 0
Views: 1447
Reputation: 606
Maybe something like this? (not tested!)
RewriteRule ^data/(.*)$ /$1 [R=301,L]
Upvotes: 1