.htaccess redirect

Connect with other users about what to run on your webhosting (and how to run it) here.
Post Reply
User avatar
aStonedPenguin
New to forums
New to forums
Posts: 11
https://www.youtube.com/channel/UC40BgXanDqOYoVCYFDSTfHA
Joined: Sun Dec 22, 2013 12:28 am

.htaccess redirect

Post by aStonedPenguin »

Currently I am using:

Code: Select all

RewriteEngine on
RewriteCond %{REQUEST_URI}  !^/forums [NC]
RewriteRule ^(.*)$          http://superiorservers.co/forums/$1 [R=301,L]
I am trying to redirect www.SuperiorServers.co and SuperiorServers.co to SuperiorServers.co/forums The problem I am having is I still want to be able to access other sub folders such as SuperiorServers.co/sup but with what I have it redirects all URLs to /forums
User avatar
Edge100x
Founder
Founder
Posts: 13120
Joined: Thu Apr 18, 2002 11:04 pm
Location: Seattle
Contact:

Re: .htaccess redirect

Post by Edge100x »

Are you sure that you need all URLs converted from xxx to /forums/xxx ? If not, then it would be best to just redirect the root of the site.

I wouldn't expect you to need the full conversion unless you previously ran the forums from the bare domain, and your users have old bookmarks that you wish to retain.
User avatar
aStonedPenguin
New to forums
New to forums
Posts: 11
Joined: Sun Dec 22, 2013 12:28 am

Re: .htaccess redirect

Post by aStonedPenguin »

Thats what I'm trying to say all I want is www.SuperiorServers.co and SuperiorServers.co to direct to SuperiorServers.co/forums but what I have directs everything to /forums
User avatar
Edge100x
Founder
Founder
Posts: 13120
Joined: Thu Apr 18, 2002 11:04 pm
Location: Seattle
Contact:

Re: .htaccess redirect

Post by Edge100x »

Try something like:

Code: Select all

RewriteEngine on
RewriteCond %{REQUEST_URI}  ^/ [NC]
RewriteRule ^               /forums/ [R=301,L]
User avatar
aStonedPenguin
New to forums
New to forums
Posts: 11
Joined: Sun Dec 22, 2013 12:28 am

Re: .htaccess redirect

Post by aStonedPenguin »

Had the same issue with that.

Code: Select all

RewriteEngine on
RewriteRule ^$ /forums [L]
That seems to work for anyone else who may be wondering.
Post Reply