WordPress permalinks is wrong. It wants me to change my htaccess file. But then site crashes

If you look at the recommended .htaccess files for WordPress, there’s a difference (yours has example.com/, whereas the recommendation 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 I don’t know if that’s what’s causing … Read more

Leverage browser caching

Well mate you can try out the following code in .htaccess file. <IfModule mod_expires.c> ExpiresActive On ExpiresByType image/jpg “access 1 year” ExpiresByType image/jpeg “access 1 year” ExpiresByType image/gif “access 1 year” ExpiresByType image/png “access 1 year” ExpiresByType text/css “access 1 month” ExpiresByType text/html “access 1 month” ExpiresByType application/pdf “access 1 month” ExpiresByType text/x-javascript “access 1 … Read more

WordPress How to rewrite URL for custom pages

Assuming this is completely outside of WordPress then… to rewrite /test/test/123/dnfjk to /test/test.php?id=123&z=dnfjk, then you could do something like the following in the /test/.htaccess file (not the WordPress .htaccess file in the document root): Options -MultiViews RewriteEngine On RewriteRule ^test/(\d+)/([a-z]+)$ test.php?id=$1&z=$2 [L] MultiViews needs to be disabled for this to work. RewriteRule ^(.*).html$ https://example.com/$1 [R=301,L] … Read more

modifying htaccess for localhost with a custom port

To be honest, I’d change my .conf file to state the correct port if you’ve got access to that. For instance. <VirtualHost *:8012> ServerAdmin webmaster@localhost DocumentRoot /var/www/LOCATION OF FILES <Directory /> Options FollowSymLinks AllowOverride None </Directory> <Directory /var/www/LOCATION OF FILES> Options Indexes FollowSymLinks MultiViews AllowOverride None Order allow,deny allow from all </Directory> Then i’d restart … Read more

change URIs of migrated site

Site works with “plain” permalinks. Check write permission in your main wordpress dir, maybe wordpress can’t write .htaccess file (you can upload it via FTP). Check if mod_rewrite on server is enabled. mod_rewrite status can be checked printing phpinfo(). If .htaccess file is missing, upload a similar one: # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On … Read more