.htaccess redirect in wordpress

I would like users that go to the website ‘http://kevingstongramado.p.ht/‘,

to be redirected to ‘http://kevingstongramado.p.ht/catalogo/‘. Which is in fact a wordpress website.

Read More

I´ve tried this:

Redirect 301 /http://kevingstongramado.p.ht/ http://kevingstongramado.p.ht/catalogo/

Putting the .htaccess inside the root directory of the website. Not the root directory of the folder which contains the wordpress.

Doesn´t work.

“catalogo” is the folder which contains the ‘index.php’ that opens the wordpress website.

Anyone?

Related posts

Leave a Reply

2 comments

  1. Use RedirectMatch

    If I am not wrong, you should use the relative path.

    Create the index file index.htm in your root folder. Then,

    RedirectMatch 301 /index.htm /catalogo//$1
    
  2. .htaccess files are calculated by searching and interpreting the configuration for every .htaccess file in every directory in the path under the document root.

    You want something along the lines of

    RewriteCond ${REQUEST_URI} !^/catalogo/ [NC]
    RewriteRule ^(.*)$ /catalogo/$1 [L]
    

    This makes the rule conditional. It will only execute the rule if /catalogo/ is not present in the request uri. And the actual rule says to take everything and put /catalogo/ in front of it… and that it is the last rule to be executed in the file. This file will be reprocessed when it goes to the /catalogo/ directory.