Forum Moderators: phranque

Message Too Old, No Replies

check my htaccess please

         

liriotherapy

11:36 am on Jun 18, 2016 (gmt 0)

5+ Year Member



Hi my website: <snip>
My website is new in worldpress, I'm getting too many error pages 404 for the old pages, I would like to add rules in there, also I found this in my hat.access see bellow:
Could you check please if this is genuine or I should remove?
Where can I gett this code to add in the hat.access please?
thanks
>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress

# # av:php5-engine
AddHandler av-php5 .php

php_value post_max_size 20M
php_value upload_max_filesize 20M
php_value memory_limit 128M

# # av:Toolbar
SetEnv AV_TOOLBAR 1

[edited by: engine at 12:01 pm (utc) on Jun 18, 2016]
[edit reason] no sites, please. see ww TOS [/edit]

lucy24

5:29 pm on Jun 18, 2016 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Every WordPress installation creates its own htaccess if one doesn't already exist. Currently the WP part is surrounded by # comment lines for "Begin" and "End" WordPress, and then an <IfModule> envelope directly inside those lines.* Do not touch this section. If you need to add rules of your own, put them immediately before the WordPress section, outside of its # comment lines. You do not need <IfModule> envelopes, but leave the ones that WP put.

whitespace or someone like him once experimented and found that the line "RewriteEngine On" only needs to occur once, anywhere in htaccess; it doesn't matter if it's before, after or in the middle of your RewriteRules. It doesn't matter about RewriteBase, because your own rules won't require one.

Your own rules will generally go in this order:

#1 exemption for your custom 403 page, if you have one
#2 any access-control rules (the ones with [F] flag)
#3 rules for files you've removed ([G] flag only)
#4 external redirects (flag [R=301,L])
#5 rules in [L] alone, including WP's built-in section. If any part of your site is hard-coded pages, list them by name so the WP section doesn't have to keep checking whether they exist.

You don't say whether your old files-- the ones that currently get a 404 response-- are to be redirected to a new URL, or simply get a 410 Gone.

I don't know what the AddHandler part is for; if you didn't put it there, you'll have to ask your host. The lines about max size and memory limits similarly look like shared-hosting rules that are intended to protect the server if a malign agent tries to bring everything down by inserting a ten-gigabyte Forums post.


* Consider yourself lucky. In early years, WordPress simply took over your entire htaccess, and you made changes at your own risk. Now it limits itself to a clearly delimited section.

Marshall

8:09 pm on Jun 18, 2016 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



# # av:php5-engine
AddHandler av-php5 .php

It is saying to use PHP5 for all .php pages. Seems redundant though, assuming the server is set to PHP5.

lucy24

9:44 pm on Jun 18, 2016 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Seems redundant though

Normally there's a default, so AddHandler implies "use something other than the default". In fact I dimly remember a post from someone whose AddHandler lines, inherited from an earlier site on a different server, actually broke the site because it was specifying some exact Handler that didn't exist on the present site.

liriotherapy

10:27 pm on Jun 18, 2016 (gmt 0)

5+ Year Member



What can I do, my website is html5, remove the hat.access, or contact my host, or contact the webmaster

not2easy

1:49 am on Jun 19, 2016 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



Do not remove the htaccess file. WordPress will not work without any .htaccess file. Are you saying that someone other than you manages your site? If your concern is about having 404 errors is it because those pages are supposed to be there and they are not? Or are the errors caused by files that are not supposed to be on your site? Sorry, but this seems confusing. Normally if a page or image is gone, you see a 404 error, but it doesn't mean anything important unless that page or image is supposed to be there. If it is supposed to be there, then you find out why it is returning a 404 error.

lucy24

3:21 am on Jun 19, 2016 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



or contact the webmaster

Wait, stop, rewind. I thought you were the webmaster. Who else would be concerned about htaccess?

You have not yet explained what you want to have happen instead of the 404. The main options are to return a 410 response (if you've removed something and it isn't coming back) or 301 redirect to a different URL (if you've moved a file, or if WordPress has created a comprehensive URL restructuring).