.htaccess file redirect code on a subdomain (1 Viewer)

vba_php

Forum Troll
Local time
Today, 06:45
Joined
Oct 6, 2019
Messages
2,884
has anyone ever hard coded an HTTP redirect inside this file? some agents at GoDaddy are better than others, and 2 nights I was lucky to get a guy to do this for me, but since then I've not had much luck. and of course, the management there wants to make money rather than help customers, so I have 1 subdomain left where I need to put redirect code in this file myself. Here is the code inside the .htaccess file on another subdomain of mine which the helpful agent at GoDaddy did:

# BEGIN GD-SSL
<IfModule mod_rewrite.c>
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteCond %{HTTP_USER_AGENT} ^(.+)$
#RewriteCond %{SERVER_NAME} ^subdomain1.adamevanovich\.com$ [OR]
RewriteCond %{SERVER_NAME} ^subdomain1.adamevanovich\.com$
RewriteRule .* https://%{SERVER_NAME}%{REQUEST_URI} [R=301,L]
Header add Strict-Transport-Security "max-age=300"
</IfModule>
# END GD-SSL

# BEGIN WordPress
# The directives (lines) between `BEGIN WordPress` and `END WordPress` are
# dynamically generated, and should only be modified via WordPress filters.
# Any changes to the directives between these markers will be overwritten.
<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
AuthType Basic
AuthName "rootDirectory"
AuthUserFile "/home/siteownder/.htpasswds/public_html/subdomain1.adamevanovich.com/passwd"
require valid-user


and this is the code that is inside the .htaccess file on the subdomain that doesn't have any redirects on it:

# BEGIN WordPress
# The directives (lines) between `BEGIN WordPress` and `END WordPress` are
# dynamically generated, and should only be modified via WordPress filters.
# Any changes to the directives between these markers will be overwritten.
<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 will try to fix this myself, but can anyone spot the fix to this? I'm assuming it just takes a bit of copy-and-paste magic and changing text.....(both sites have the same version of wordpress installed and are very similar in terms of the amount of content and source PHP code that it uses.
 

vba_php

Forum Troll
Local time
Today, 06:45
Joined
Oct 6, 2019
Messages
2,884
this has been solved. the solution was to copy the old redirect code into the old file, and add 2 additional lines of code.
 

SarbjitGrewal

New member
Local time
Today, 17:15
Joined
Sep 11, 2020
Messages
13
this has been solved. the solution was to copy the old redirect code into the old file, and add 2 additional lines of code.
It has also solved my problem too. Thank YOu
 

Users who are viewing this thread

Top Bottom