Creating . httacess for wordpress

Asked

Viewed 53 times

0

I set up a wordpress on a linux hosting, need to set up so that the post url instead of:

http://www.example.com/index.php/post

be it:

http://www.example.com/post

From what I read I must mecher in httpd.conf file but this is impossible because I am hosting the site. In this link they teach how to edit httpd.conf for this problem: https://wordpress.org/support/topic/permalinks-without-indexphp-2?replies=1

How to create a . htaccess ? I tried to put the code:

<IfModule mod_rewrite.c>
    RewriteEngine On

    # Send would-be 404 requests to Craft
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_URI} !^/(favicon\.ico|apple-touch-icon.*\.png)$ [NC]
    RewriteRule (.+) index.php?p=$1 [QSA,L]
</IfModule>

But when you upload this file the site gives a 500 error. I inserted the file in both www and root folder before www

  • You put this.htaccess in the even directory that wp?

  • Yes, in the same directory, inside the www/ folder but the 500 error on the server.

1 answer

0


correct code for . htaccess

So that Wordpress doesn’t need the /index.php/ in the permantent links.

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

Create in notepad and save as: Como Salvar o .htaccess no notepad

Browser other questions tagged

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