Htaccess Wordpress URL Problem

Asked

Viewed 429 times

1

I have a project that has an institutional website (main domain example: client.com.br) and a blog with Worpdress in sub-domain(example: blog.cliente.com.br).

I have an htaccess in the root directory (institutional site) controlling my friendly URL and an htaccess in the /blog directory (my sub-domain).

The Htaccess of my Wordpress is this:

# BEGIN WordPress
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
# END WordPress

Everything was working right. It turns out I had to change the structure, and my sub-domain blog.cliente.com.br became a common directory client.com.br/blog by limitations in customer accommodation.

What happens is that:

  • When I access client.com.br/blog visualizo o blog certinho.
  • If I sail to client.com.br/blog/wp-admin I can access the administrator.
  • Sometimes, when I access a post like client.com.br/blog/2017/11/27/a-porcelana-historia-e-beleza/ doesn’t work and loads the contents of the index of my client.com.br domain.

Do I have to rewrite something in my htaccess from the /blog directory? Or in my htaccess from the main directory? I don’t know much about htaccess modifications and have always used only the basics for my friendly Urls.

1 answer

2


Solved!

I went to the panel > Settings > Permanent Links and updated its structure to recreate a new file. htaccess.

Automatically correcting and referencing the directory.

Became:

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

    I’m glad you decided, Aryana. You can accept your own answer to mark as resolved.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.