how to modify Apache to Allow URL Rewrites?

Posted January 23, 2015 10.4k views

I want to Configure Pretty Permalinks for WordPress according to

when to sudo nano /etc/apache2/sites-available/000-default.conf

1.There is no 000-default.conf in default? to fill it ?
1) my wordpress address is bulid on
where is the ServerName ?
2) how to fill the file?Is the following format right?

<VirtualHost *:80>
ServerAdmin webmaster@localhost
DocumentRoot /var/www/html
ServerName serverdomainnameorIP
<Directory /var/www/html/>
AllowOverride All
</VirtualHost *:80>

1 comment
  • The file you are looking for may be


    instead of


    You can view what files are in the sites-available directory using the ls command:

    ls /etc/apache2/sites-available/

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.

Submit an Answer
1 answer

root@change:~# ls /etc/apache2/sites-available/
default default-ssl

root@change:~# cat /etc/apache2/sites-available/default
<VirtualHost *:80>
ServerAdmin webmaster@localhost

    DocumentRoot /var/www
    <Directory />
            Options FollowSymLinks
            AllowOverride None
    <Directory /var/www/>
            Options Indexes FollowSymLinks MultiViews
            AllowOverride None
            Order allow,deny
            allow from all

    ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
    <Directory "/usr/lib/cgi-bin">
            AllowOverride None
            Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
            Order allow,deny
            Allow from all

    ErrorLog ${APACHE_LOG_DIR}/error.log

    # Possible values include: debug, info, notice, warn, error, crit,
    # alert, emerg.
    LogLevel warn

    CustomLog ${APACHE_LOG_DIR}/access.log combined


I have tested to change “AllowOverride None” into “AllowOverride All” in the file “ /etc/apache2/sites-available/default” and set permalinks in wordpress setting to post name and input the command :
sudo a2enmod rewrite
sudo service apache2 restart


There is the last problem remain here:
What is the different betwwen them :
/etc/apache2/sites-available/default and /etc/apache2/sites-available/default-ssl?