I use this mod_rewrite do redirect requests from domain.com to domain.com/folder in .htaccess:
- Code: Select all
<IfModule mod_rewrite.c>
# Turn on rewrites.
RewriteEngine on
# Only apply to URLs on this domain
RewriteCond %{HTTP_HOST} ^(www.)?domain.com$
# Only apply to URLs that aren't already under folder.
# RewriteCond %{REQUEST_URI} !^/folder/
# Don't apply to URLs that go to existing files or folders.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# Rewrite all those to insert /folder.
RewriteRule ^(.*)$ folder/$1
# Also redirect the root folder.
RewriteCond %{HTTP_HOST} ^(www.)?domain.com$
RewriteRule ^(/)?$ domain.com/index.php [L]
</IfModule>
But the links of my site are: domain.com/folder/link.html
I need to change it to domain.com/link.html
What I'm need to change in .htaccess to get it to work?