I need a ligth on an .htaccess file that i dont understand.
I am using linux with apache2 and cant figure what is wrong.
I had this working but changed something and not working anymore.
Here is the .htaccess. I want to say i just start to fix bugs in this legacy software. I am more a Js than php developer.
<IfModule mod_headers.c>
Header set X-UA-Compatible "IE=edge" "expr=%{CONTENT_TYPE} =~ m#text/html#i"
Header set X-Content-Type-Options "nosniff"
<FilesMatch "\.(eot|otf|tt[cf]|woff2?)$">
Header set Access-Control-Allow-Origin "*"
</FilesMatch>
</IfModule>
# 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
Im using a virtual host.
I can see myhost.com but soon a click a link, i get a 404 not found error
i know is something with apache or php , because this code is working in another server. I supose. They say so.
Please. Thanks.
Sorry i had a typo on sites available conf file
Related
A site new to me as of today is broken. It is a wordpress site that the client tried to convert to HTTPS by themselves and it broke. They then tried to undo the work and go back to non-s version.
this has worked with one exception. The site is trying to redirect scripts to the SSL version.
For example trying to access this:
http://example.com/wp-includes/js/jquery/jquery.js?ver=1.12.4
is redirecting to this:
https://www.example.com/js/jquery/jquery.js?ver=1.12.4
(not the real domain.. obv)
Can anybody advise on how to fully revert?
If it helps, the Security Cert was purchase through Namecheap. The hosting is GoDaddy, and they attempted to follow the instructions here: https://designmodo.com/wordpress-https/
** edit **
SSL has been reinstalled, and it doesn't appear to be the problem. Something is redirecting scripts, removing the "wp-includes" from the url
the htaccess
# BEGIN GD-SSL
<IfModule mod_rewrite.c>
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteCond %{HTTP_USER_AGENT} ^(.+)$
RewriteCond %{SERVER_NAME} ^example\.com$ [OR]
RewriteCond %{SERVER_NAME} ^www\.example\.com$
RewriteRule .* https://%{SERVER_NAME}%{REQUEST_URI} [R=301,L]
Header add Strict-Transport-Security "max-age=300"
</IfModule>
# END GD-SSL
# 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
Wordpress save a lot of content and settings in the database, try installing this plugin Velvet Blues Update URLs to find-replace in your database the old values https://example.com with http://example.com some plugins save their own cache, so you probably need to go into a file browser and delete their cache folders.
If that doesn't work double check that your .htaccess is not redirecting your http traffic to https.
I have used a theme on wordpress named "SATINE" and I have finished my website but I have a problem that I have not face it yet. This theme is using FontAwesome icons in some places that are configured via widgets section. The problem is that that FontAwesome Icons are not showing on the website. Instead of icons there are replaced with squares like here (Printscreen: http://prntscr.com/j4znsc). I checked my error logs on Plesk and I found this ( Printscreen: http://prntscr.com/j4zoae). I think that It has to do with SSL and with the file .htaccess but I cannot configure it right. I am pasting my .htaccess file here so you can see what its written inside and help me or give me a hint.
# BEGIN WordPress
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
Can anyone help me or does anyone have already faced the same problem with me?
I think it has to do with this line:
<FilesMatch ".(eot|ttf|otf|woff)">
Header set Access-Control-Allow-Origin "*"
</FilesMatch>
but I dont know how to configure it right.
Thank you,
Best regards
I think your syntax is incorrect, try this with the leading forward slash.
<IfModule mod_headers.c>
<FilesMatch "\.(eot|ttf|otf|woff)$">
Header set Access-Control-Allow-Origin "*"
</FilesMatch>
</IfModule>
I installed the latest version of wordpress in my hosting server. How ever I was not able to add any media. I checked the server space and I have still of huge free space. And then I try to access settings --> media , I got this error
You don't have permission to access /wp-admin/ on this server.
Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request.
I added the this into my .htaccess file but still no luck
# BEGIN WordPress
<IfModule mod_security.c>
SecFilterEngine Off
SecFilterScanPOST Off
</IfModule>
<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?
-Alan-
You must download Filezilla and put permissions 755 on every WP file inside your hosting. Also, if this don't work, try to remove all plugins, maybe some plugin is causing the problem.
This is driving me crazy. Its definitely not a cache issue and I've tested the rules at http://htaccess.madewithlove.be/, all work ok. But for some reason I cant get ANY rewriterules to work. I've just added a simple one for testing but if anyone could suggest its maybe wordpress or it is something glaringly obvious in my htaccess?
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
#rewrites
RewriteRule ^test.html$ http://www.google.co.uk/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
#redirects
Redirect 301 /success-stories.html /success-stories/
Redirect 301 /introductions-agency-news/ /dating-agency-news/
Redirect 301 /how-do-we-do-it.html /our-service/
Redirect 301 /1.html /
</IfModule>
# END WordPress
In host admin There's a config directive called AllowOverride where you specify which config directives can be overridden by .htaccess. I originally had it set to allowing specific features which included ReWrite. However, I just set it to "All" and obviously, that seems to have done it.
Im having problem with my addon domain, on my primary domain everything works fine, I have the wordpress installed and running perfectly using the following htaccess:
RewriteCond %{HTTP_HOST} ^(www\.)?addon-domain\.com
Rewriterule .* - [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>
On addon domain subfolder It's working and loading site like an individual domain as I wish it to be but images are not loading, the following addon domain htaccess file:
Options -MultiViews -Indexes +FollowSymlinks
<IfModule mod_security.c>
SecFilterEngine Off
SecFilterScanPOST Off
</IfModule>
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE application/x-javascript text/css text/html text/xml
</IfModule>
RewriteCond %{HTTP_HOST} ^addon\-domain\.com$ [OR]
RewriteCond %{HTTP_HOST} ^www\.addon\-domain\.com$
RewriteRule ^/?$ "http\:\/\/domain\.com\/addon\-domain\.com" [R=301,L]
Now... I tried hotlink disabled, enabled with rules for each domain and addon, not deal... tried removing domain htaccess and nothing happeans.
Im running a videoscript in addon domain and thumbnails for videos works fine, when I upload images it's loading normally, but all css images and subfolders images like logo arent. :-(
I can access css, js and other templates files using direct address but no one single image file opens... on firefox i got this error message:
The image "http://addon-domain.com/templates/frontend/default/images/videozoom.png" cannot be displayed because it contain errors.
And all other images in different folders display same message... I have only Htacces file on root domain and addondomain folder.
Any help will be appreciated.
just add your site to hotlink protection and everything will work fine =D