Forum Moderators: phranque
[edited by: phranque at 5:18 am (utc) on Sep 27, 2013]
[edit reason] Please Use example.com [webmasterworld.com] [/edit]
The .htaccess file is inside the /forums folder. Should it be in that subfolder or directly within the root directory?
I just want to redirect anything with "support" in it to go to "forums"
www.example.com/support/forum/this-game-is-great www.example.com/forums/this-game-is-great www.example.com/support/how-do-i-login www.example.com/forums/how-do-i-login www.example.com/support/general-forum/what-events-are-happening-today www.example.com/forums/what-events-are-happening-today No subdirectories. "support" IS the actual subdirectory. All of the folders below it such as /forums/admincp and /forums/images are folders supporting it.
www.example.com/support/forum/this-game-is-great should redirect to www.example.com/forums/this-game-is-great
The .htaccess file is inside the /forums folder. Should it be in that subfolder or directly within the root directory?
Here is the code I am using for the redirect:
<IfModule mod_rewrite.c>
Options +FollowSymLinks
RewriteEngine On
RewriteBase /forums/
# Redirect old forum path to new forum path
RewriteRule ^support/(.*)$ http://www.example.com/forums/$1 [R=301,L]
www.example.com/support/general-forum/what-events-are-happening-today
should redirect to
www.example.com/forums/what-events-are-happening-today
Is htaccess able
This .htaccess file will redirect
# Redirect old forum path to new forum path
RewriteCond %{QUERY_STRING} ^support/(.*)$
RewriteRule ^support$ http://www.luviniaworld.com/forums/%2 <IfModule mod_rewrite.c>
Options +FollowSymLinks
RewriteEngine On
RewriteBase /forums/
# Send css calls directly to the correct file VBV-7807
RewriteRule ^css.php$ core/css.php [NC,L]
# Redirect old install path to core.
RewriteRule ^install/ core/install/ [NC,L]
# Redirect old forum path to new forum path
RewriteCond %{QUERY_STRING} ^support/(.*)$
RewriteRule ^support$ http://www.mywebsite.com/forums/%2
# Main Redirect
RewriteCond %{REQUEST_URI} !\.(gif|jpg|jpeg|png|css)$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?routestring=$1 [L,QSA]
# Because admincp is an actual directory.
RewriteRule ^(admincp/)$ index.php?routestring=$1 [L,QSA]
</IfModule> # Redirect old forum path to new forum path
RewriteRule ^support/(.*)$ http://www.example.com/forums/$1 [R=301,L] But if I put /support/index.php, it will lead me to a forum page stating "invalid page".
RewriteRule ^(admincp/)$ index.php?routestring=$1 [L,QSA]
Isn't that what you wanted to do? Redirect absolutely all requests for /support/ to /forums/ ?
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{QUERY_STRING} ^support/(.*)$
RewriteRule ^support$ http://www.example.com/forums/%1 [L,QSA] But if I put /support/index.php, it will lead me to a forum page stating "invalid page".
/support isn't redirecting....just giving me a "Forbidden You don't have permission to access /support/ on this server." error
RewriteRule ^support/(.*)$ http://www.example.com/forums/$1 [R=301,L] Options +FollowSymLinks
RewriteEngine on
RewriteRule ^support/(.*)$ http://www.example.com/forums/$1 [R=301,L] [edited by: phranque at 5:07 am (utc) on Oct 1, 2013]
[edit reason] Please Use example.com [webmasterworld.com] [/edit]