Hoping it is just a simple fix
Posted: Wed Aug 10, 2022 3:05 am
Hi good people,
I have run into a small problem with my site and that is I currently cannot update my www.example.com home page. I can only update www.example.com/index
It seems that I have two separate pages one being .com and the other .com/index and I cannot update the .com page anymore.
I know it is me who has done something as I was playing around in htaccess files, which I will paste here.
So when I go to example.com live after uploading the page, which is index in my program it is not updated, only if I type in example.com/index will it show the updated page live.
Here are my current htaccess files >>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME}.html -f
RewriteRule ^(.*)$ /$1.html [L]
<ifModule mod_gzip.c>
mod_gzip_on Yes
mod_gzip_dechunk Yes
mod_gzip_item_include file .(html?|txt|css|js|php|pl)$
mod_gzip_item_include handler ^cgi-script$
mod_gzip_item_include mime ^text/.*
mod_gzip_item_include mime ^application/x-javascript.*
mod_gzip_item_exclude mime ^image/.*
mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.*
</ifModule>
# BEGIN Expire headers
<ifModule mod_expires.c>
ExpiresActive On
ExpiresDefault "access plus 5 seconds"
ExpiresByType image/x-icon "access plus 2592000 seconds"
ExpiresByType image/jpeg "access plus 2592000 seconds"
ExpiresByType image/png "access plus 2592000 seconds"
ExpiresByType image/gif "access plus 2592000 seconds"
ExpiresByType application/x-shockwave-flash "access plus 2592000 seconds"
ExpiresByType text/css "access plus 604800 seconds"
ExpiresByType text/javascript "access plus 216000 seconds"
ExpiresByType application/javascript "access plus 216000 seconds"
ExpiresByType application/x-javascript "access plus 216000 seconds"
ExpiresByType text/html "access plus 600 seconds"
ExpiresByType application/xhtml+xml "access plus 600 seconds"
</ifModule>
# END Expire headers
# BEGIN Cache-Control Headers
<ifModule mod_headers.c>
<filesMatch "\.(ico|jpe?g|png|gif|swf)$">
Header set Cache-Control "public"
</filesMatch>
<filesMatch "\.(css)$">
Header set Cache-Control "public"
</filesMatch>
<filesMatch "\.(js)$">
Header set Cache-Control "private"
</filesMatch>
<filesMatch "\.(x?html?|php)$">
Header set Cache-Control "private, must-revalidate"
</filesMatch>
</ifModule>
# END Cache-Control Headers
ErrorDocument 500 https://www.example.com/404.php ( I have purposely changed that back to "example")
ErrorDocument 404 https://www.example.com/404.php
The reason why I was playing around with this, is because I wanted my .com/index web traffic going to .com and I was trying to redirect it. The 500 and 404 pages are necessary as some of my pages do not exist anymore, which can still be found on Google and the like. I have requested that they be moved, Google is quick others not so.
Big thanks as ever,
Martin.
I have run into a small problem with my site and that is I currently cannot update my www.example.com home page. I can only update www.example.com/index
It seems that I have two separate pages one being .com and the other .com/index and I cannot update the .com page anymore.
I know it is me who has done something as I was playing around in htaccess files, which I will paste here.
So when I go to example.com live after uploading the page, which is index in my program it is not updated, only if I type in example.com/index will it show the updated page live.
Here are my current htaccess files >>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME}.html -f
RewriteRule ^(.*)$ /$1.html [L]
<ifModule mod_gzip.c>
mod_gzip_on Yes
mod_gzip_dechunk Yes
mod_gzip_item_include file .(html?|txt|css|js|php|pl)$
mod_gzip_item_include handler ^cgi-script$
mod_gzip_item_include mime ^text/.*
mod_gzip_item_include mime ^application/x-javascript.*
mod_gzip_item_exclude mime ^image/.*
mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.*
</ifModule>
# BEGIN Expire headers
<ifModule mod_expires.c>
ExpiresActive On
ExpiresDefault "access plus 5 seconds"
ExpiresByType image/x-icon "access plus 2592000 seconds"
ExpiresByType image/jpeg "access plus 2592000 seconds"
ExpiresByType image/png "access plus 2592000 seconds"
ExpiresByType image/gif "access plus 2592000 seconds"
ExpiresByType application/x-shockwave-flash "access plus 2592000 seconds"
ExpiresByType text/css "access plus 604800 seconds"
ExpiresByType text/javascript "access plus 216000 seconds"
ExpiresByType application/javascript "access plus 216000 seconds"
ExpiresByType application/x-javascript "access plus 216000 seconds"
ExpiresByType text/html "access plus 600 seconds"
ExpiresByType application/xhtml+xml "access plus 600 seconds"
</ifModule>
# END Expire headers
# BEGIN Cache-Control Headers
<ifModule mod_headers.c>
<filesMatch "\.(ico|jpe?g|png|gif|swf)$">
Header set Cache-Control "public"
</filesMatch>
<filesMatch "\.(css)$">
Header set Cache-Control "public"
</filesMatch>
<filesMatch "\.(js)$">
Header set Cache-Control "private"
</filesMatch>
<filesMatch "\.(x?html?|php)$">
Header set Cache-Control "private, must-revalidate"
</filesMatch>
</ifModule>
# END Cache-Control Headers
ErrorDocument 500 https://www.example.com/404.php ( I have purposely changed that back to "example")
ErrorDocument 404 https://www.example.com/404.php
The reason why I was playing around with this, is because I wanted my .com/index web traffic going to .com and I was trying to redirect it. The 500 and 404 pages are necessary as some of my pages do not exist anymore, which can still be found on Google and the like. I have requested that they be moved, Google is quick others not so.
Big thanks as ever,
Martin.