Remove index.php from wordpress url on aws ec2 cloud instance

Remove index.php from wordpress url on aws ec2 cloud instance

Want to remove index.php from your wordpress website url?

On some servers it is pretty straightforward, BUT on cloud i.e. AWS or any other provider, it is bit tricky as our server might not be properly configured.

Here we go-

Step 1: Run this command  cd /etc/apache2/sites-enabled/

Step 2: Open the file “000-default-conf” in your favorite editor

sudo nano 000-default.conf

Step 3: Add the following rule:

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

And save the file by pressing ‘ctrl+x’. It will ask for ‘yes’ or ‘no’, press ‘y’ and enter.

Step 4: Install apache mod_rewrite module and run the following command on your ssh

sudo a2enmod rewrite

Step 5: Restart the apache server

sudo service apache2 restart

And ENJOY

Share this post

Comments (2)

  • devang Reply

    I have tried many tweaks and suggestions and surf many sites to remove ‘index.php’ from my URL but this suggestion by adding block into default.conf work like a charm for me, thanks my friend, keep sharing..!

    July 28, 2016 at 6:57 pm
  • Swapna Reply

    I don’t have the apache folder in my etc directory of my ec2 server how can I do ?

    November 9, 2016 at 5:10 am

Leave a comment

Your email address will not be published.