Remove /sites/25/ from image URLS

I assume you want to internally rewrite the URL, rather than externally redirect the request… To rewrite the image URL-path to remove /sites/25 for the espanol subdomain only then try something like the following using mod_rewrite at the top of the .htaccess file, before the WordPress front-controller: RewriteCond %{HTTP_HOST} ^espanol\. RewriteRule ^(wp-content/uploads)/sites/25/(\d{4}/\d\d/[\w-]+\.jpg)$ /$1/$2 [L] Following … Read more

how to redirect 301 my old search query string to wordpress search query string?

Try something like the following at the top of your root .htaccess file (before the WordPress block): RewriteCond %{QUERY_STRING} ^search=([^&]*) RewriteRule ^cgi-bin/mt/mt-search\.cgi$ /?s=%1 [R=301,L] %1 in the RewriteRule substitution is a backreference to the captured group in the preceding CondPattern (ie. the value of the search URL parameter – “WORDS”). Clear your browser cache before … Read more

Can’t upload .htaccess after editing in notepad

using notepad to enforce secure page. Format is UTF-8. The problem is that Windows Notepad saves UTF-8 files with a Byte Order Mark (BOM) – which it uses to identify the file encoding (other systems, Apache included, do not require this). If you look at the saved file in a hex editor, you will see … Read more

Giving to wordpress it’s own directory cause login loop

…this is the .htaccess file inside the directory where wordpress is installed That is certainly incorrect as it’s sending requests back to the root. You can remove the RewriteBase directive and remove the slash prefix on the RewriteRule substitution string, ie /index.php should be index.php. For example: # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On #RewriteBase … Read more

Site in subfolder – all pages work except home

Because when you request the document root, the rule in .htaccess does not match and the request is not rewritten to the subdirectory. So the request falls through and whatever is the default response for the document root is served (eg. /index.php if it exists). You need to add another directive to rewrite the homepage … Read more

How can I set Cache TTL for woff and woff2 font files with htaccess?

ExpiresByType font/woff2 “access plus 1 year” ExpiresByType application/font-woff2 “access plus 1 year” ExpiresByType application/x-font-woff2 “access plus 1 year” You need to set ExpiresActive On (at the top) for these directives to have any effect. You also don’t need all 3 of these directives. You should check the Content-Type HTTP response header for the mime-type your … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)