Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

My problem is in my wordpress site only default permalinks is working.. When I change permalinks all pages become not found.. only home page is showing.

When I change permalinks to postname .htaccess content change to

# 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

And for default it is

# BEGIN WordPress

# END WordPress

Also tried to get the status of mod_rewrite using this

in_array( 'mod_rewrite', apache_get_modules())

It returns 1 and mod_rewrite is enabled on my server and also checked using phpinfo(). mod_rewrite module is loaded.. I have gone through all the documents available in internet.. Please help me to solve this problem.. My hosting server is godaddy..

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
362 views
Welcome To Ask or Share your Answers For Others

1 Answer

In case you are on Ubuntu, edit the file /etc/apache2/apache2.conf (here we have an example of /var/www):

<Directory /var/www/>
        Options Indexes FollowSymLinks
        AllowOverride None
        Require all granted
</Directory>

and change it to:

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

also check Apache configuration file for your website /etc/apache2/sites-available/your_site.conf:

<Directory /var/www/your_site_path/>
    AllowOverride None
</Directory>

and change it to:

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

You need to do sudo a2enmod rewrite to enable module rewrite

then,

sudo service apache2 restart

I hope this helps you!


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...