WordPress.org

Ready to get started?Download WordPress

Forums

Help with my .htaccess (3 posts)

  1. Firkraag85
    Member
    Posted 6 years ago #

    Hi everyone,

    I need your help... I try to move my blog from /blog to /, but I have many problems... So I changed it with .htaccess in wp-admin.

    So... My .htaccess is now:

    # BEGIN WPSuperCache
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /blog/
    AddDefaultCharset UTF-8
    RewriteCond %{REQUEST_METHOD} !=POST
    RewriteCond %{QUERY_STRING} !.*s=.*
    RewriteCond %{QUERY_STRING} !.*attachment_id=.*
    RewriteCond %{HTTP_COOKIE} !^.*(comment_author_|wordpress|wp-postpass_).*$
    RewriteCond %{HTTP:Accept-Encoding} gzip
    RewriteCond %{DOCUMENT_ROOT}/wp-content/cache/supercache/%{HTTP_HOST}/$1/index.html.gz -f
    RewriteRule ^(.*) /wp-content/cache/supercache/%{HTTP_HOST}/blog/$1/index.html.gz [L]

    RewriteCond %{REQUEST_METHOD} !=POST
    RewriteCond %{QUERY_STRING} !.*s=.*
    RewriteCond %{QUERY_STRING} !.*attachment_id=.*
    RewriteCond %{HTTP_COOKIE} !^.*(comment_author_|wordpress|wp-postpass_).*$
    RewriteCond %{DOCUMENT_ROOT}/wp-content/cache/supercache/%{HTTP_HOST}/$1/index.html -f
    RewriteRule ^(.*) /wp-content/cache/supercache/%{HTTP_HOST}/$1/index.html [L]
    </IfModule>

    # END WPSuperCache

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>

    # END WordPress

    The problem is that all my index in Google are to /blog/... How can I do if some get into my site, for example to: http://www.colegioyapeyu.edu.ar/blog/2008/06/site change to: http://www.colegioyapeyu.edu.ar/2008/06.

    Without the .htaccess that adds WordPress, when I moved the files this works:

    Redirect 301 /blog/ http://www.colegioyapeyu.edu.ar/
    Redirect 301 /blog http://www.colegioyapeyu.edu.ar/

    But now not, How can I do that?

    Thanks in advance.

  2. Firkraag85
    Member
    Posted 6 years ago #

    This is the solution at the beginning of the .htaccess

    RewriteEngine ON

    RewriteRule ^/blog(.+)$ http://www.colegioyapeyu.edu.ar/$1 [NC,R=302,L]

  3. Firkraag85
    Member
    Posted 6 years ago #

    Another problem...

    How to do this generates a 301 instead of 302?

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>

    # END WordPress

    Its generates me a doble 302...

    This http://web-sniffer.net/?url=http%3A%2F%2Fwww.colegioyapeyu.edu.ar%2Frrhh&submit=Submit&http=1.1&gzip=yes&type=GET&uak=0 redirect to the same place. How to fix it?

    And this to the right place: http://web-sniffer.net/?url=http%3A%2F%2Fwww.colegioyapeyu.edu.ar%2Fblog%2Frrhh&submit=Submit&http=1.1&gzip=yes&type=GET&uak=0 but 302, instead of 301.

    Can anyone help me? Thanks.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.