Wordpress Permalinks not working - wordpress

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.
Create .htaccess in the correct folder, containing the code as suggested by Krige.
Enable mod_rewrite on apache, then restart the server, as suggested by Mike Lynn.
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.

Related

Wordpress page not found on AWS

I have transferred a wordpress website on AWS (EC2 and RDS-Mysql servers). The DNS has been setup in Route53.
The wordpress files has been located under directory:
/var/www/html
And the mysql database is imported on RDS. The home page looks fine but when I click on the other pages, it gives "404 not found" error. I have modified /etc/httpd/conf/httpd.conf file to allow WordPress to use permalinks:
<Directory "/var/www/html">
AllowOverride All
I have also checked the size of transferred files and they look as same as the main files.
Any help would be appreciated.
I could solve my problem by adding .htaccess file in the directory of my wordpress files.
# 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
http://guiem.info/permalinks-on-wordpress-amazon-ec2/
Try to follow these steps:
In the WordPress dashboard go to Settings > Permalinks
Without changing anything click on the Save button
And then try to click on the inner pages, it should load fine.
Why does this happen? When you change server, the paths and urls are changed. When you save permalink settings then WordPress will update its rewrite rules and so it will work fine.

Unable to change Permalink - Tried tons of tricks

I am using wordpress on godaddy windows hosting. using 4,7,4 version of wordpress.
For some reason permalinks do not work in any mode except of plain, selecting any other structure results in 404 errors at all pages except of home. I know there is a ton of similar questions, but none of the existing solutions does not help (at least all solutions I could find).
.htaccess file is changing when permalink structure is modified, it adds a code that looks as it supposed to be:
# 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
Giving different permissions doesn’t do anything.
According to the hosting provider the web server meets all requirements
The website is using woocommerce. Disabling all plugins was tried as well – no effect.
Any other ideas how can I fix this or at least where the problem is? Thanks in advance
You may need to enable mod_rewrite to accept the server to access the formatted URL's
Edit , httpd.conf
AllowOverride all
Also inside php.ini remove ; from the below extension,
extension=php_curl.dll

Wordpress subpages throwing 404 after restoring

I am a newbie to wordpress though I have programming background. Recently I moved a wordpress website from justhost shared server to a
linode vps server (Ubuntu OS). I did following steps to achieve it
Set up apache2 server on vps
Set up virtualhost on vps
Created a directory under /var/www/ftpadmin/www/
Note. ftpadmin was created to restrict ftp access to files under that folder. I could make work static html and php websites after doing so.
Took backup of database and wp-content folder from justhost server of respective wordpress website.
Now on vps, at specified location above, first I download latest version of wordpress and unzipped the files.
Created database of same name at mysql and then imported original to the same database.
replaced new wp-content folder with the one from original one.
I was following instructions on https://www.digitalocean.com/community/articles/how-to-set-up-multiple-wordpress-sites-on-a-single-ubuntu-vps.
restarted apache server. Now I could access the home page.
I corrected the database values for wordpress url and site address url to new one at older location and reloaded database which helped me access dashboard and login pages also.
I created a .htaccess file like mentioned in http://ahsan.vimmaniac.com/blog/enabling-wordpress-permalinks-on-ubuntu/.
I also changed "AllowOveride" under both section in /etc/apache2/sites-available/ as
<Directory />
Options FollowSymLinks
AllowOverride all
</Directory>
<Directory /var/www/ftpadmin/www/domainname>
RewriteEngine On
Options Indexes FollowSymLinks MultiViews
AllowOverride FileInfo
Order allow,deny
allow from all
</Directory>
restarted service apache once again.
One final point, I am using a custom template and so I have a header.php and header-sub.php file for homepage and navigation.
Now here is the problem. When I click on any submenu I get "Internal Server Error".
If I remove .htaccess and reload apache server. Now I get 404 error while clicking on and submenu.
Any help is highly appreciated? I looked at various sites to collate these many steps and execute. I have no Idea what I should do to correct this situation. But when I go dashboard -> All pages, I can find all pages existing there with contents.
Thanks in Advance
Fayaz
EDIT
Added .htaccess file from comment:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /wordpress/ (wordpress replaced with my domainname, bottom also)
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /wordpress/index.php [L]
</IfModule>
I got the above problem fixed by just replacing
RewriteBase /wordpress/ as "RewriteBase /"
and
RewriteRule ./wordpress/index.php [L} as "RewriteRule . /index.php [L]".
in .htaccess file.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
Finally fixed this errow after browsing for a couple of hours and trying many options.
In this block in your Apache httpd.conf file, (located in my CentOS instance at $ sudo vi /etc/httpd/conf/httpd.conf)
#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# Options FileInfo AuthConfig Limit
#
AllowOverride None
change AllowOverride None to AllowOverride All.
Src: https://wordpress.org/support/topic/secondary-or-child-pages-returning-a-404-error-after-wp-34-update#post-3830892

How can I get my permalinks working when uploading the database to a localhost?

I've been working on my localhost machine developing my wordpress site, and I'm going to export the database and import it to another localhost on another machine. The thing is, I've tried it already and when lets say you click on about it gives a 404 error not found in database. I'm using custom permalink structure /%postname%/
But when in the new localhost I change the custom to default it works. I don't want to /p?=123 at the end of my URL since I already have my links set up. Was wondering how I can set up the links to work?
you need to click on the wamp server, choose the apache menu -> apache modules then move the menu down and choose rewrite_module. You will need the server to restart for the changes to take affect.
If your .htaccess file is writable and mod_rewrite is enabled, WordPress will insert this code when you change the permalink structure. If it is not writable, WordPress will let you know to copy and past this code into the .htaccess
# 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

permalinks in wordpress

I just moved my wordpress blog from one host to another but permalink is giving trouble. Other than the homepage, other pages give a page not found error.
I edited the htaccess as per instructions
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /projects/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /wdmgroup/index.php [L]
</IfModule>
I even tried deleting the htaccess and rewriting but to no avail.
P.S : htaccess and Mod Rewriteare both enabled in Apache's conf
Regards,
Loveleen
Delete .htaccess and reset permalinks from within Admin at Dashboard>>Settings>>Permalinks to be sure permalinks are set in the database as well as in the .htaccess file that WP generates.
Be sure WP is in /wdmgroup/ , because that's where it should be located, according to your .htaccess.
If you're moving WP to root, see Moving WordPress « WordPress Codex.
According to your .htaccess file, your site should be in the http://www.site.com/projects/wdmgroup/ - folder. Is it so? Also, have you update needed entries in the wp_options table in your database?
I found the solution. Everything else was tried but still it didnt work. Later i realized that I had to make a Virtual DIrectory in apache for folder wdmgroup which I had directly placed inside the www folder.
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/>
FollowSymLinks
AllowOverride All
</Directory>

Resources