changing the .htaccess file in wordpress - wordpress

I was trying to use permalink feature of WordPress on my localhost so I just made copy the code which was generated by WordPress when I clicked on post name from Common Settings. I saved that generated code in my localhost where the wordpress index.php file was stored in the name of .htaccess and now when I am going to visit the page, url bar of the browser is showing the full address of the post but the post can not be seen on the browser.Only the 404 Not Found error is comming. Can someone tell me what is the wrong part here?

You should let wordpress write this file for your localhost server.
You cannot simply copy .htaccess from another server and expect it will work, you have to modify it to reflect your server conf.
You should modify RewriteBase and the last RewriteRule, e.g. for http://localhost/wordpress :
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /wordpress/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /wordpress/index.php [L]
</IfModule>

Related

Can't Access Current Wordpress Web Pages

I'm uploading my website to Apache on CentOS on Google Cloud and I can't access all of my existing web pages, I get the following error:
Not Found
The requested URL /home was not found on this server.
However, when I create a new page I can access it no problem.
I've uploaded my files again, and double checked all the database stuff checked out and I've checked my .htaccess file. I can't figure out what's going on.
Make sure that the .htaccess file contains the following content:
# 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 should also check if .htaccess is actually working. The easiest way to check this is to intentionally break it, by adding some text to the file. If .htaccess is working you should get an Internal Server Error page.

htaccess subdirectory and wordpress

I have a php based site with wordpress installed in a subdirectory.
The main php site has urls in the following form
http://www.smokescreencreative.co.uk/nameofpage
which are rewritten using htaccess so they actually access pages like so:
http://www.smokescreencreative.co.uk/index.php?pid=$1
This all works as needed. My problem is with the /blog subdirectory. When in the blog part of the site trying to click on a link back to the main part of the site actually directs to
http://www.smokescreencreative.co.uk/blog/nameofpage
instead of
http://www.smokescreencreative.co.uk/nameofpage
as required and I am getting a 404 error because there is nothing there. I think this must be down to my htaccess files but I can't work out how to make it so the links to the main php page take the form I want but the blog post etc stay in the /blog/nameofpage format.
I did manage to get it so /blog/nameofpage was bringing in the correct written content for the root pages but there was no styling or images and the url was still /blog/nameofpage and I would like it to be just /nameofpage if possible.
I've posted the htaccess code for the root directory and blog subdirectories below. any help with this would be much appreciated.
Thanks in advance
main root htaccess code: (works for the links in the root part of the site)
AddType application/x-httpd-php .php .html .htm
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.+)$ /index.php?pid=$1 [L]
htaccess code for the wordpress subdirectory
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /blog/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /blog/index.php [L]
</IfModule>
# END WordPress

Possible permalink or .htaccess error, wordpress

Okay. So I have a site that needs to be live around 8am EST. Everything was going fine, but when I uploaded it to the server my two pages return 404 not found errors. Absolutely everything else on the site is fine.
I have tried several things. I have reset the permalinks several times. I have deleted auto-saved files in the database. I have re-uploaded the database. I have re-uploaded the site. I have set the permission on .htaccess. I have deleted .htaccess and let it rewrite itself. Nothing has worked. Does anyone have any ideas?
The page works when it is set to default, but NOT when it is set to anything else.
Update This is the .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
Based on the .htaccess you can make these changes... although this is the default .htaccess for Wordpress it looks like it has an extra slash in front of index.php for the main redirect line. You'll also want to check to make sure that your Virtual Host Apache directory contains AllowOverride All.
In this example we're telling Apache if the request isn't for index.php then see if it's a real file and a real directory, then if it's not show them the default page. This is similar to the default behavior of Wordpress already.
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} !=index.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^.* index.php [L]
</IfModule>
# END WordPress
There is also a whole Stack Exchange site devoted to Wordpress at wordpress.stackexchange.com.
This is basically the same question:
https://wordpress.stackexchange.com/questions/11149/htaccess-disable-wordpress-rewrite-rules-for-folder-and-its-contents

Wordpress 404 PAGE

I recently migrated my site to a new domain and a sub dir under that domain. quivinat.com/quv1anTemp/ My Wordpress 404 page is going to an old page seems to be from where my site use to be because it is pulling in the old header. I did a test and I modified the 404.php but it did not have any effect on the 404 landing page.
Not sure what is going on.
Any suggestions.
Try typing in "quivinat.com/quv1antemp/ and you will notice that the header is says HotFoot. This is my old header.
.htaccess file is as follows
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /quv1anTemp/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /quv1anTemp/index.php
</IfModule>
# END WordPress
In the dashboard under General > Settings the Wordpress URL and Site Address must be changed to use the new domain.

internal server error in subdomains

I installed worpress to my main domain abcd.com. My addon domain name is fghi.com, when i try to access any worng page form addon domain for example fghi.com/fdsf i see internal server error.
I am using .htaccess file in root directory of wordpress installation. Here is code:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
anybody know the correct solution?
Wordpress can't be successfully accessed from your secondary domain because the Wordpress installation site url is set to one address. In your case, Wordpress recognizes "abcd.com" as the site url, and therefore any other url, even though it may point to the correct folder, will cause an internal service error

Resources