• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

.htaccess redirection help

wickedstangs

Well-known member
#1
Ok, I need some help, @Jake Bunce @Brogan I just noticed that google has wiped everything that is on my site from there search engine. Only visible is the url.

I went from www.wickedstangs.com/community to www.wickedstangs.com

Below is my code can someone give me a hand please
Code:
<IfModule mod_rewrite.c>
    RewriteEngine On
  
    RewriteCond %{HTTP_HOST} ^wickedstangs\.com [NC]
        RewriteRule ^(.*)$ http://www.wickedstangs.com/$1 [R=301,L]

    #    If you are having problems with the rewrite rules, remove the "#" from the
    #    line that begins "RewriteBase" below. You will also have to change the path
    #    of the rewrite to reflect the path to your XenForo installation.
    #RewriteBase /xenforo

    #    This line may be needed to enable WebDAV editing with PHP as a CGI.
    #RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

        RewriteCond %{ENV:rwdone} !^yes$
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -l [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RedirectMatch 301 ^/community/?$ http://www.wickedstangs.com
    RewriteRule ^.*$ - [NC,L]
    RewriteRule ^(data/|js/|styles/|install/|favicon\.ico|crossdomain\.xml|robots\.txt) - [NC,L]
    RewriteRule ^.*$ index.php [NC,L]
    RewriteRule ^community/(.*)?$ /$1 [R=301,L]
</IfModule>
Google Search
google.JPG
 

wickedstangs

Well-known member
#4
This should work:
Code:
RewriteEngine On
RedirectMatch 301 /community/(.*) http://www.wickedstangs.com/$1

Where exactly do I place it? Like Below?

Code:
<IfModule mod_rewrite.c>
    RewriteEngine On
 
    RewriteCond %{HTTP_HOST} ^wickedstangs\.com [NC]
        RewriteRule ^(.*)$ http://www.wickedstangs.com/$1 [R=301,L]

    #    If you are having problems with the rewrite rules, remove the "#" from the
    #    line that begins "RewriteBase" below. You will also have to change the path
    #    of the rewrite to reflect the path to your XenForo installation.
    #RewriteBase /xenforo

    #    This line may be needed to enable WebDAV editing with PHP as a CGI.
    #RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

        RewriteCond %{ENV:rwdone} !^yes$
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -l [OR]
    RewriteCond %{REQUEST_FILENAME} -d
RedirectMatch 301 /community/(.*) http://www.wickedstangs.com/$1
    RedirectMatch 301 ^/community/?$ http://www.wickedstangs.com
    RewriteRule ^.*$ - [NC,L]
    RewriteRule ^(data/|js/|styles/|install/|favicon\.ico|crossdomain\.xml|robots\.txt) - [NC,L]
    RewriteRule ^.*$ index.php [NC,L]
    RewriteRule ^community/(.*)?$ /$1 [R=301,L]
</IfModule>
 

Mr. Goodie2Shoes

Well-known member
#5
I've updated the code for you:

Code:
<IfModule mod_rewrite.c>
  RewriteEngine On
  RedirectMatch 301 /community/(.*) http://www.wickedstangs.com/$1
  RewriteCond %{HTTP_HOST} ^wickedstangs\.com [NC]
  RewriteRule ^(.*)$ http://www.wickedstangs.com/$1 [R=301,L]

  #  If you are having problems with the rewrite rules, remove the "#" from the
  #  line that begins "RewriteBase" below. You will also have to change the path
  #  of the rewrite to reflect the path to your XenForo installation.
  #RewriteBase /xenforo

  #  This line may be needed to enable WebDAV editing with PHP as a CGI.
  #RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

  RewriteCond %{ENV:rwdone} !^yes$
  RewriteCond %{REQUEST_FILENAME} -f [OR]
  RewriteCond %{REQUEST_FILENAME} -l [OR]
  RewriteCond %{REQUEST_FILENAME} -d
  RewriteRule ^.*$ - [NC,L]
  RewriteRule ^(data/|js/|styles/|install/|favicon\.ico|crossdomain\.xml|robots\.txt) - [NC,L]
  RewriteRule ^.*$ index.php [NC,L]
</IfModule>
 

tommydamic68

Well-known member
#7
Ok, I need some help, @Jake Bunce @Brogan I just noticed that google has wiped everything that is on my site from there search engine. Only visible is the url.

I went from www.wickedstangs.com/community to www.wickedstangs.com

Below is my code can someone give me a hand please
Code:
<IfModule mod_rewrite.c>
    RewriteEngine On
 
    RewriteCond %{HTTP_HOST} ^wickedstangs\.com [NC]
        RewriteRule ^(.*)$ http://www.wickedstangs.com/$1 [R=301,L]

    #    If you are having problems with the rewrite rules, remove the "#" from the
    #    line that begins "RewriteBase" below. You will also have to change the path
    #    of the rewrite to reflect the path to your XenForo installation.
    #RewriteBase /xenforo

    #    This line may be needed to enable WebDAV editing with PHP as a CGI.
    #RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

        RewriteCond %{ENV:rwdone} !^yes$
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -l [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RedirectMatch 301 ^/community/?$ http://www.wickedstangs.com
    RewriteRule ^.*$ - [NC,L]
    RewriteRule ^(data/|js/|styles/|install/|favicon\.ico|crossdomain\.xml|robots\.txt) - [NC,L]
    RewriteRule ^.*$ index.php [NC,L]
    RewriteRule ^community/(.*)?$ /$1 [R=301,L]
</IfModule>
Google Search
View attachment 82831
I will watch this closely. I was also thinking of doing this. If you don't mind, how did you go about going from the community folder to the root- was it complicated to do? Anything besides the .htacess file?
 

wickedstangs

Well-known member
#8
I will watch this closely. I was also thinking of doing this. If you don't mind, how did you go about going from the community folder to the root- was it complicated to do? Anything besides the .htacess file?
it wasn't complicated at all very easy but, I would not recommend it. I have been battling the .htaccess file issue for a long time and it has'nt been fine since. Hope fully @Mr. Goodie2Shoes will put things back to norm....

https://xenforo.com/community/threa...need-to-modify-in-htaccess.80047/#post-807221

https://xenforo.com/community/threads/moving-site-to-root.74907/