Question

wordpresss on 18.04 wp admin pages just downloads a php file

Every time i click on pages or all pages in wp-admin, I download a php file instead of viewing the pages. I’ve heard this can be a htaccess file issue but can’t locate it to edit and debug. I’ve disabled all plugins and still nothing but a file download and when i open it is has all sorts of stuff i don’t really understand but seems to have to do with a notification for permission of something.

I’m brand new to ubuntu and linux but learning commands like nano to view or edit docs in the console.

I tried to locate the htaccess but the main locations didn’t have any.

I think i need some help.


Submit an answer


This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

alexdo
Site Moderator
Site Moderator badge
July 29, 2019
Accepted Answer

Hello

You can create a new .htaccess file in the WordPress main directory. You can use the default WordPress .htaccess file:

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

Let me know how it goes.

Alex

OK

So…

it is working in Edge but not in Chrome???

Any ideas?

i just wrote my reply in a random thread by accident ugh… thank you its a long recovery. so .htaccess was there but hidden and it opened had wordfence jargon in it so i removed all but exactly what you wrote which was there. still having issues and i had already deleted wordfence to debug …??

Become a contributor for community

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

DigitalOcean Documentation

Full documentation for every DigitalOcean product.

Resources for startups and SMBs

The Wave has everything you need to know about building a business, from raising funding to marketing your product.

Get our newsletter

Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.

New accounts only. By submitting your email you agree to our Privacy Policy

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.