.htaccess/ redirect issue

Can not get URL to redirect properly

Page 1 of 1

3 Replies - 4092 Views - Last Post: 15 January 2014 - 04:45 PM

#1 tommydamic68  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 15-January 14

.htaccess/ redirect issue

Posted 15 January 2014 - 02:36 PM

Hello all,
This is the third site I am bringing my issue to- hope you guys can break the trend of not being able to figure this out! The problem is, when typing in my URL example.com - the URL redirects to example.com/community/ as it should. My forum software is in a folder "community." So it's public_html/ community/
The issue is- you can also type www.example.com/community which as you know is picked up
But to Google it's like two separate sites, so I need every combination to redirect to http://example.com/community/
Here is my .htaccess file currently - any help is greatly appreciated! It's driving me nuts!

Options -Indexes 
RewriteEngine On 
RewriteCond %{HTTP_HOST} !^(example.com)?$ [NC] 
RewriteRule (.*) http://example.com/$1 [R=301,L] 
RewriteCond %{HTTP_HOST} www.example.com$ 
RewriteRule ^(.*)$ http://example.com/$1 [R=301,L] 
RewriteRule ^[^/]+/.+-([0-9]+)/$ /community/index.php?threads/$1/ [R=301,L] 
RewriteRule ^forum\.php$ /community/ [R=301,L] 
RewriteRule ^(images|dir2|dir3|dir4)/.*$ - [S=1] 
RewriteRule ^$ /community/ [R=301,L] 

# Use PHP 5.3 
AddType application/x-httpd-php53 .php 


DirectoryIndex index.php 
#RewriteEngine Off 

# Comment the following line (add '#' at the beginning) 
# to disable mod_rewrite functions. 
# Please note: you still need to disable the hack in 
# the vBSEO control panel to stop url rewrites. 


# Some servers require the Rewritebase directive to be 
# enabled (remove '#' at the beginning to activate) 
# Please note: when enabled, you must include the path 
# to your root vB folder (i.e. RewriteBase /forums/) 
#RewriteBase / 

#RewriteCond %{HTTP_HOST} !^www\.example\.com 
#RewriteRule (.*) http://www.example.com/$1 [L,R=301] 


<Files 403.shtml> 
order allow,deny 
allow from all 
</Files> 

#RewriteCond %{HTTP_HOST} ^example.com$ 
#RewriteRule ^/?$ "http\:\/\/www\.example\.com\/" [R=301,L] 

#RewriteCond %{HTTP_HOST} ^example.com$ 
#RewriteRule ^forum\.+\/?(.*)$ "http\:\/\/www\.example\.com\/forum\.php$1" [R=301,L] 
# Expire images header 
ExpiresActive On 
ExpiresDefault A0 
ExpiresByType image/gif A2592000 
ExpiresByType image/png A2592000 
ExpiresByType image/jpg A2592000 
ExpiresByType image/jpeg A2592000 
ExpiresByType image/ico A2592000 
ExpiresByType text/css A2592000 
ExpiresByType text/javascript A2592000 
# compress text, html, javascript, css, xml: 
AddOutputFilterByType DEFLATE text/plain 
AddOutputFilterByType DEFLATE text/html 
AddOutputFilterByType DEFLATE text/xml 
AddOutputFilterByType DEFLATE text/css 
AddOutputFilterByType DEFLATE application/xml 
AddOutputFilterByType DEFLATE application/xhtml+xml 
AddOutputFilterByType DEFLATE application/rss+xml 
AddOutputFilterByType DEFLATE application/javascript 
AddOutputFilterByType DEFLATE application/x-javascript 
# Or, compress certain file types by extension: 
<files *.html> 
SetOutputFilter DEFLATE 
</files> 


Is This A Good Question/Topic? 0
  • +

Replies To: .htaccess/ redirect issue

#2 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 9275
  • View blog
  • Posts: 34,778
  • Joined: 12-June 08

Re: .htaccess/ redirect issue

Posted 15 January 2014 - 02:40 PM

Quote

so I need every combination to redirect t

'Every Combination' of what? general URLs? URLs outside the folder?
Was This Post Helpful? 0
  • +
  • -

#3 tommydamic68  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 2
  • Joined: 15-January 14

Re: .htaccess/ redirect issue

Posted 15 January 2014 - 03:35 PM

View Postmodi123_1, on 15 January 2014 - 02:40 PM, said:

Quote

so I need every combination to redirect t

'Every Combination' of what? general URLs? URLs outside the folder?


Hi- if you type example.com it brings you to example.com/community/ when you type in www. Example.com it brings you to example.com/community/ the problem is when you type In www.example.com/community/ it does not redirect to example.com/community/ as it should. Hope that makes sense.
Was This Post Helpful? 0
  • +
  • -

#4 no2pencil  Icon User is online

  • Admiral Fancy Pants
  • member icon

Reputation: 5346
  • View blog
  • Posts: 27,303
  • Joined: 10-May 07

Re: .htaccess/ redirect issue

Posted 15 January 2014 - 04:45 PM

This isn't an issue with html/css. Moving to web servers & hosting.
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1