i have an issue with WordPress. The site working pretty normal but on the admin panel, various pages like edit post, installed plugins, add new plugin, add new page, settings redirects me to homepage. I'm googling like crazy for 3 days but i just found the mod_security issue. And it turned out useless for me too.
here is my .htaccess file
RewriteEngine On
RewriteBase /
RewriteCond /home/gokkur/public_html/wp-content/sitemaps%{REQUEST_URI} -f
RewriteRule \.xml(\.gz)?$ /wp-content/sitemaps%{REQUEST_URI} [L]
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
SecFilterEngine Off
SecFilterScanPOST Off
this is default content of WP .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
Maybe your custom rewrite rules generating problems.
Related
I'am using wordpress as my blog in my laravel site. The wordpress blog are placed in subdirectories so that the domain of the wordpress is mydomain.com/blog.
I've tested it in my localhost and it works perfectly. But when i deployed it on server the site can show the homepage of my blog. But it can't display the blog's page ex. domain.com/blog/contact (404 Page not found) .
I've done several steps like changed the .htaccess and define the WP_HOME /WP_SITEURL but it still doesn't works to show my blog post .
Here is my wordpress .htaccess
<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>
And here are my laravel site's .htaccess
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
Options -MultiViews
</IfModule>
RewriteEngine On
RewriteCond %{REQUEST_URI} !^/blog/ # <=== NEW LINE!!!!
# Redirect Trailing Slashes If Not A Folder...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/$ /$1 [L,R=301]
# Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
# Handle Authorization Header
RewriteCond %{HTTP:Authorization} .
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
what am i doing wrong here?
I'm using wordpress for a site,
this url before tes.com/index.php/about/
i want url like this tes.com/about/
I have tried copying parts of WordPress' .htaccess, however shows a 404 error.
My .htaccess file looks like:
# 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
Any ideas on where to start and how to accomplish what I'm looking for?
Go to your WP-ADMIN-->Settings-->Permalink and use the permalink structure change there, if it generate any .htaccess file copy the content and update your .htaccess file.
Or Check if your hosting mod_rewrite is enable by creating a file phpinfo.php with content,
Upload this file and browse via Browser. So you know which modules are enabled. You need mod_rewrite enable to remove index.php from URL.
Try this -
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /test.com/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /test.com/index.php [L]
</IfModule>
The official instructions will give you clean urls. So best to follow this
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
I am converting my old site on wordpress and I don't want to loose any of the indexed "juice" as the old site has been going for 2years or so.So i have to make the same url.In my wordpress site i want to add .html at the and of my URL. I am using a plugin thats adding .html to all pages.
but its not adding .html on my product page.I want to add .html to all of my urls.
It has been suggested to us to use .htaccess rules to solve the problem, but we do not know where to start.
here is my wordpress site url.
http://www.fearfashion.com/
My full htaccess looks like 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
Any help would be appreciated.
You can try a rule like this to force redirect non .html URLs to .html:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !\.html$ [NC]
RewriteRule ^(.+?)/?$ $1.html [L,R=301]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
I have a WordPress website, running at the root of my website. And an invision install running on the directory /forums/
I'm using a code to show a welcome $USER$ if logged into IPB, now recently without any change to my knowledge, possibly an update to IPB, every WordPress page/post kicks out a 404 error. But not a 404 in WordPress, a 404 under the forums?
You can see this here:
http://www.tfuhq.com/ - WordPress home page (WORKS)
http://www.tfuhq.com/autobots/ - WordPress internal page (404)
http://www.tfuhq.com/forums/ - FORUMS (WORKS)
This is the htaccess for the wordpress install:
# 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
This is htaccess for the forums:
<IfModule mod_rewrite.c>
Options -MultiViews
RewriteEngine On
RewriteBase /forums/
RewriteCond %{REQUEST_FILENAME} .*\.(jpeg|jpg|gif|png)$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule . /forums/public/404.php [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /forums/index.php [L]
</IfModule>
My settings for permalinks: default : /?p=123 works but if I switch to by post name All pages stop working and just go to a 404
Check your permalink settings and see if you have enable rewriting in your .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>