Hello, I recently setup an OLS server (1.4.41) on Ubuntu 18.04 w/ LSPHP 7.2 running WordPress (WP) and it works great, however redirect 301's are causing me some headaches. Rewrite is enabled, and LSCache is installed on WP. It works fine and the rewrite to remove WP index,php is working. However, simple 301 redirects in my htaccess file do not work.
Basic settings in htaccess
RewriteEngine on
RewriteBase /
Example of an issue:
redirect 301 /old/file-name.php https://domain.com/new/file-name.php
This just produces a 404 error. Any file with a .php does not redirect.
If I try:
redirect 301 /old/file-name https://domain.com/new/file-name
If the file name and directory are close it seems to pattern match and redirect to a similar URL but not necessarily the one I want it to go to.
The directory I use for WP files is /home/aod/wp/
Error logs shows this:
[INFO] Tried to add new context: URI /2006/ location /home/aod/wp//2006/, result 0x5632e9eaffc0
[REWRITE] Source URI: '2006/06/alberta-premium-rye-whisky.php' => Result URI: '/index.php'
[INFO] Tried to add new context: URI /wp-admin/ location /home/aod/wp//wp-admin/, result 0x5632e9ec3e90
I can see the // in the uri but don't know where it is coming from.
The two example work fine in Apache 2.4. And it is important for me to maintain these redirects as this site has been around since 2005 (MoveableType days) and to maintain so of my Google rank for SEO purposes I need these links going to the right place. I'm hoping to move to OLS but this would be a deal breaker.
Thanks for any help. Cheers
Other Details:
Using the following for index.php removal in WP:
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
Basic settings in htaccess
RewriteEngine on
RewriteBase /
Example of an issue:
redirect 301 /old/file-name.php https://domain.com/new/file-name.php
This just produces a 404 error. Any file with a .php does not redirect.
If I try:
redirect 301 /old/file-name https://domain.com/new/file-name
If the file name and directory are close it seems to pattern match and redirect to a similar URL but not necessarily the one I want it to go to.
The directory I use for WP files is /home/aod/wp/
Error logs shows this:
[INFO] Tried to add new context: URI /2006/ location /home/aod/wp//2006/, result 0x5632e9eaffc0
[REWRITE] Source URI: '2006/06/alberta-premium-rye-whisky.php' => Result URI: '/index.php'
[INFO] Tried to add new context: URI /wp-admin/ location /home/aod/wp//wp-admin/, result 0x5632e9ec3e90
I can see the // in the uri but don't know where it is coming from.
The two example work fine in Apache 2.4. And it is important for me to maintain these redirects as this site has been around since 2005 (MoveableType days) and to maintain so of my Google rank for SEO purposes I need these links going to the right place. I'm hoping to move to OLS but this would be a deal breaker.
Thanks for any help. Cheers
Other Details:
Using the following for index.php removal in WP:
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]