Automatic addition to hdaccess - wordpress

this code snippet was added to my .htaccess after I installed a plugin.
Is my site viral?
Is this normal?
<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>

Some plugins adds some snippets to the .htaccess specially the security plugins and cache plugins, the one you wrote is the basic WP .htaccess file, so I don't think there would be a problem.

Related

WordPress admin pages redirecting to homepage

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.

404 error with a 2nd Wordpress install in a sub-directory

Lots of topics similar to this one but nothing seems to have worked so far. First time posting on this site - apologies if I miss off anything vital!!
Current site is - http://www.mansfordwebdesign.com - working fine but I want a 2nd Wordpress install as a development environment. I've created a subfolder called 'ilead' via my FTP and uploaded the Wordpress files.
When I go to http://www.mansfordwebdesign.com/ilead/wp-activate.php or any other related Wordpress file I get a 404 error.
Both sites have a .htaccess file - the first is -
`# 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`
The second is
`# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /subdirectory/
RewriteRule ^index\.php$ – [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /ilead/index.php [L]
</IfModule>
# END WordPress`
Is something wrong in these files or could it be anything to do with my WHM or CPanel controls??
Any thoughts or suggestions are appreciated.
Try changing the RewriteBase line to what is below for the subfolder..
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /ilead/
RewriteRule ^index\.php$ – [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /ilead/index.php [L]
</IfModule>
# END WordPress

How to clean url wordpress

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 got a stuck with .htaccess and rewrite

I'm using Lamp server on linuxmint and i installed 2 wordpress platforms on it one called "bfsite" and the other one called "titus". I modified the .htacces file as WordPress suggest me to do
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /bfsite/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /bfsite/index.php [L]
</IfModule>
This one is for bfsite, and the I modify for the /titus platform
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /titus/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /titus/index.php [L]
</IfModule>
And a simple redirect.
Redirect /index.php http://89.39.166.81/titus
As you see I made my locahost online for you to see what's happening, when I try to go on
http://89.39.166.81/titus/about
It returns to me with http://localhost/titus/dev/ and also if you force to with this path
http://89.39.166.81/titus/dev/
It comes with a 404 and page not found error, but is going with the "bfsite" wordpress platform.
since you are under a ubuntu distro you can use this
sudo a2enmod rewrite
-- then you can enable postname from wp backend. good luck!

wordpress redirect loop on mod rewrite

I have wordpress setup to change the admin url to www.mydomain.com/admin. But now I have updated the permalinks to use the post name instaed of the id I get a redirect loop when I try to access the admin page. The problem is with the extra rules wordpress asked me to add to the .htaccess but I am unsure how to change it to allow both rules.
Wordpress 3.5.2 rewrite rules as below.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
RewriteRule ^admin/(.*) wp-admin/$1?%{QUERY_STRING} [L]
Anyone know what i need to do to allow both rules?
Was trying out a few solutions and it would seem that having the rewrite rule for changing the admin url to www.mydomain.com/admin BEFORE the mod-rewrite rules is the key to allowing both rules to work together. See updated/fixed .htaccess code below.
RewriteRule ^admin/(.*) wp-admin/$1?%{QUERY_STRING} [L]
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

Resources