Why is this sample domain www.example.com/about-us is not working even though I activate the .htaccess
AddHandler php-stable .php
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
also when you navigate also this link www.example.com/index.php/about-us it will redirect you to this www.example.com/about-us which is not working but when you navigate this www.example.com/Index.php/about-us that's the time the url is working. Please help. It host on godaddy
Seems like you are having a mod_rewrite issue with your hosting. You can create a .php page on your server lets call it phpinfo.php and write the following code in it
<?php
phpinfo();
?>
Open this page in browser and look for mod_rewrite setting. It needs to be on for permalink to work.
Now, go to your WP Admin Panel -> Settings -> Permalink and choose /post_name/ Wordpress will automatically write in .htaccess file (provided it can access it).
If mod_rewrite is not enabled on your server, there is no way other than contacting your hosting provider to enable it. It is enabled by all hosting providers still you have to cross check using phpinfo.
Following is a perfectly valid .htaccess file for WordPress
# 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
Also ensure that apache.conf is configured to be overridden by .htaccess file. Apache settings like AllowOverride none; ensure .htaccess is not honored.
As per the query you explained, I would like to suggest that you
go to WP Admin Panel -> Settings -> Permalink
Then select the radio button in front of /post_name/
Then go to WP Admin Panel -> Appearance -> Menus
Now check that you have all pages used in Menus, or is there any custom link you have used?
Also check your .htaccess
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php
</IfModule>
# END WordPress
Related
We using server centos. Running my site, currently working home page itself, rest of page not working. Please help me
File Path
/var/www/html
Not Found
The requested URL /about-us/ was not found on this server. this error coming out.
.htaccess file
# 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
You can login in wp-admin backend with credentials Administrator.
You need to be sure that the .htaccess file is editable
So, go in Settings -> Permalink, and refresh this (save without edit anything).
Another test:
I suggest return your permalink to default ( /?p=ID ) so you ensure that .htaccess is the problem.
Could someone help me; where am i doing wrong?
My wordpress site is not in root; i installed it in a directory(newsite/) I mean; there are 2 sites.
My root site(example.com) has default htaccess file.
And this is my sub wordpress site's(example.com/newsite/) .htacces source:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /newsite/
RewriteRule ^newsite/news/hello-world /newsite/news/?title=hello-world [L]
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /newsite/index.php [L]
</IfModule>
# END WordPress
I just want:
www.example.com/newsite/news/hello-world
(above url should open the url at below; without url change at address bar)
www.example.com/newsite/news/?title=hello-world
Check with different permalink options.
Note : .htaccess file should be writable or paste the suggested code in .htaccess after permalink saved.
Okay, I've got a working wp installation (www.SITEURL1.co.uk) at the root of SERVER1 and I want to move another wordpress (www.SITEURL2.co.uk) I have in another server (SERVER2), in a subfolder of (www.SITEURL1.co.uk/onlinerevision) right now like this:
ROOT(siteurl1)
wp-admin
wp-content etc.
(SITEURL1/onlinerevision/)
wp-admin
wp-content etc..
So I put the 2nd wp installation files into the given (www.SITEURL1.co.uk/onlinerevision/) subfolder. Now I can see the homepage is accessible, the css is not okay and also all the links are redirecting to the www.SITEURL2.co.uk
e.g: www.SITEURL1.co.uk/onlinerevision/login/ is redirected to www.SITEURL1.co.uk/login/ or
www.SITEURL1.co.uk/onlinerevision/signup/ is redirected to www.SITEURL1.co.uk/signup/
Also www.SITEURL1.co.uk/onlinerevision/wp-login.php is looping in a redirect to the same page (www.SITEURL1.co.uk/onlinerevision/wp-login.php) and I can't login to dashboard like this:
http://siteurl1.co.uk/onlinerevision/wp-login.php?redirect_to=http%3A%2F%2Fsiteurl1.co.uk%2Fonlinerevision%2Fwp-admin%2F&reauth=1
In the database I opened for www.SITEURL1.co.uk/onlinerevision/, I'm changing the wp_options table -> siteurl from www.SITEURL2.co.uk/ to www.SITEURL1.co.uk/onlinerevision/
but somehow it's turning back to www.SITEURL2.co.uk/
Apparently www.SITEURL1.co.uk and www.SITEURL1.co.uk/onlinerevision/ both have the same htaccess codes:
# 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
I tried different methods but didn't work. Any help would be really appreciated!
Thanks for your time.
Sorry got side tracked again.
First, lets address the .htaccess files.
In the root you want to tell it to ignore your second WordPress installation directory.
/.htaccess
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
# Skip your second WordPress installation
RewriteCond %{REQUEST_URI} !^/(onlinerevision|onlinerevision/.*)$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
For the second installation you want to set the RewriteBase then tweak the final rule so it uses it properly.
onlinerevision/.htaccess
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
# Set the RewriteBase to this directory
RewriteBase /onlinerevision/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# Remove the slash before index.php or we end up at root
RewriteRule . index.php [L]
</IfModule>
# END WordPress
Second, there are two places you need to change the site URL when you move a WordPress installation. They are both located in the wp_options table. One is named siteurl and the other is named home.
I yanked a copy of one of my test sites and moved it to a directory in another test site then set those two .htaccess files and was golden. Most other oddities in a move are related to plugins/themes or URLs embedded in pages/posts. If you still have issues try disabling all themes/plugins to see if it clears up.
Debugging mod_rewrite
Also, you can turn on logging for mod_rewrite to help narrow it down. The log can be cryptic but once you figure out how to read it you can usually pick out what is going wrong or at least narrow it down. To do that you need to add a couple lines to the server conf (not htaccess file). A good place is the VirtualHost directive for the site you are having trouble with...
RewriteEngine On
RewriteLog "/var/log/httpd/rewrite.log"
# From 0 (no logging) to 9 (OMFG make it stop)
RewriteLogLevel 3
PS: Logging over 2-3 has a significant impact on your server so only use it when debugging and don't forget to turn it off when done.
In general option in wordpress, I have changed the wordpress directory to be on http://mywebsite.com but wordpress dashboard is still in htpps causing mixed content warning and images in dashboard are not displayed even after disabling mixed content filter on firefox.
I this is my .htaccess file
Options +FollowSymlinks
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{SERVER_PORT} ^443$
RewriteRule ^(.*)$ http://%{HTTP_HOST}/$1 [R=301,L]
# BEGIN WordPress
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
# END WordPress
</IfModule>
What is the possible solution to overcome this problem.
There is a setting in your wp-config.php file that directs all admin traffic over https. You would need to disable that option for your admin panel to work correctly.
FORCE_SSL_ADMIN needs to be false:
define('FORCE_SSL_ADMIN', false);
solves the issue. See relevant WordPress Codex pages:
http://codex.wordpress.org/Administration_Over_SSL
http://codex.wordpress.org/Function_Reference/force_ssl_admin
Whenever I set the permanent links on wordpress to something other than the default
p=123
The links go to 404 pages
For example:
http://thewebsite.com/i/blog/2012/05/sample-post/
Would be linked as the blog post, but it would take you to a 404 result.
What can cause this kind of issue?
You need to have a rewrite in place.
In the root of your website, create a .htaccess file. This will be a hidden file but if you are using Filezilla as a FTP program you will be able to view it.
Put in it this:
# 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
Save it in the root of your website, ie, where wp-config goes and it should work.
If you have your website in a sub directory you will need to change the Rewrite base to reflect this instead of / for root.
Hope this helps!