开发者

Wordpress Permalinks not working

I moved my site from slichost to Amazon ec2. After moving i made necessary settings for wordpress. My first page for wordpress works fine, but the permalinks are not working. Can anyone please let me know what changes are necessary to make the开发者_运维百科 permalinks working.

Thanks


Check your apache configuration and verify that for the directory in which you store your Wordpress installation you have following settings enabled (probably you will have more configuration options for the specific directory, but these are the minimum required for Wordpress fancy permalinks):

<Directory var/www/>
Options FollowSymLinks
AllowOverride All
</Directory>


After moving to a new linux host and installing a fresh wordpress, we had to make ALL of the following changes in order to enable pretty permalinks.

  1. Create .htaccess in the correct folder, containing the code as suggested by Krige.
  2. Enable mod_rewrite on apache, then restart the server, as suggested by Mike Lynn.
  3. Change the apache configuration to FollowSymLinks and AllowOverride All for /var/www/, as suggested by Cninroh. For us /etc/apache2/sites-enabled/000-default was the file we had to edit.


I was having issues getting Permalinks (other than default) to work on Mac OSX and the following was very much useful. It seems that by default Mac's are not .htaccess ready by default and Apache will ignore the file until certain files (specified on the links below) are modified:

http://wordpress.org/support/topic/getting-pretty-permalinks-working-on-a-mac-105-server

http://clagnut.com/blog/350/

Hope that helps!


Create a .htaccess file in your wordpress directory and put into it the following code:

# 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

Source


I was able to fix this by:

  • logging into wp-admin for my site
  • changing the Settings | Permalinks option to something different
  • save changes
  • changing the Settings | Permalinks option back to its original value
  • save changes

This seemed to re-enable permalinks, which did not originally work.


Try adding index.php/ before the permalink path.


While checking the apache configuration is essential and probably the first step, you also need to ensure that apache has the mod_rewrite module enabled... Depending upon the AMI from Amazon that you used, you will need to :

  • Install apache and conditionally enable mod_rewrite.

    a2enmod rewrite

  • Restart the server

    Aa


When you set permalinks option other than default, the following code is already posted in .htaccess file.

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

# END WordPress

But that doesn't help as you already know.

So, this will work when you set rewrite_module, this can be done by going to "fix permissions" if available in your cpanel or you may contact your host.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜