How do I get WordPress Rewrite to work properly with Apache?

Linode Staff

I still can't get ReWrite to work for Wordpress.

Not Found
The requested URL was not found on this server.
Apache/2.4.25 (Debian) Server at example.com Port 443

Any help is appreciated.

Thanks

6 Replies

Hey there,

You'll want to make sure that you've updated your wordpress site's apache config to include the following options. This will instruct Apache to allow individual sites to update the .htaccess file.

<Directory /var/www/html/example.com/public_html>
    Options Indexes FollowSymLinks
    AllowOverride All
    Require all granted
</Directory>

Once you have updated your apache configuration, you'll need to reload the Apache service by running sudo systemctl reload apache2.

If you're still running into issues, you'll want to look at whether the .htaccess file is properly configured. If you're not sure how to configure your .htaccess file or how to format the rules you'd like to apply, you can take a look at this rule generator that can help with making sure all of your rules are formatted correctly.

I hope the information I provided helps.

Regards,
Ryan L.
Linode Support Staff

It would also be helpful to configure the new vhosts in Apache

FYI, just got this : Failed to reload apache2..service: Unit apache2..service not found.

Added above Config suggestion to :
/etc/apache2/sites-available/000-default.conf

Is that the correct conf file ?

Will restart via Dashboard and see what happens.

Got this structure :

/var/www/html

/var/www/wordpress

So maybe need to change the suggestion from :

<Directory /var/www/html/example.com/public_html> Options Indexes FollowSymLinks AllowOverride All Require all granted </Directory>

To :

<Directory /var/www/wordpress ??? Options Indexes FollowSymLinks AllowOverride All Require all granted </Directory>

@viewr --

It would be very helpful to go through your last 2 posts and format them properly by adding 3 backticks (```) before/after sections of apache2 configuration directives.

The backticks turn the section into code where the '>' and '<' characters are not interpreted by the markdown processor (like in @rl0nergan's post above).

If you do this, we can all see what you're talking about. The way it is now, what you posted is just gibberish. For more information, see the Markdown Cheatsheet link to the right. Here's another one.

-- sw

Thanks for the suggestion and your time.

I think I solved the problem by enabling :

<Directory "var/www/"> AllowOverride All </Directory>

in the security.conf file under apache2

--- K

Reply

Please enter an answer
Tips:

You can mention users to notify them: @username

You can use Markdown to format your question. For more examples see the Markdown Cheatsheet.

> I’m a blockquote.

I’m a blockquote.

[I'm a link] (https://www.google.com)

I'm a link

**I am bold** I am bold

*I am italicized* I am italicized

Community Code of Conduct