htacess file to redirect azure defualt domain to main domain
Tag : php , By : Matt Logan
Date : March 29 2020, 07:55 AM
will help you If Both the url are pointing to single location then use the following RewriteEngine On
RewriteCond %{HTTP_HOST} !^www.old_site.com$ [NC]
RewriteRule ^(.*)$ http://www.new_site.com/$1 [L,R=301]
|
How to check if the main domain matches a certain domain and then redirect the request in .htaccess?
Tag : apache , By : user187383
Date : March 29 2020, 07:55 AM
wish help you to fix your issue What I want to accomplish is that when the user tries to visit the site with url like the following : , Unless I am missing something you can simplify this by using: RewriteEngine On
## Avoid use of HTTPS for TEST SERVER
# if current host is test
RewriteCond %{HTTP_HOST} ^test\.canvas-events\.co\.uk$ [NC]
# and if HTTPS is turned on
RewriteCond %{HTTPS} on
# redirect to non-HTTPS version
RewriteRule ^ http://%{HTTP_HOST}%{REQUEST_URI} [L,R=301,NE]
## Redirect all www or non www to https
# if HTTPS is off
RewriteCond %{HTTPS} !on [OR]
# OR if current host canvas-events.co.uk (non-www)
RewriteCond %{HTTP_HOST} ^canvas-events\.co\.uk$ [NC]
# redirect to https and www
RewriteRule ^ https://www.canvas-events.co.uk%{REQUEST_URI} [L,R=301,NE]
|
Redirect Wordpress main domain index.php to a page (same domain)
Date : March 29 2020, 07:55 AM
wish helps you Just a quick query. Checking your thoughts on how to redirect a Wordpress main domain index.php to a page (same domain). For example, my WordPress domain is https://maindomain.com which is the same as https://maindomain.com/index.php. I prefer to redirect permanently to https://maindomain.com/page/ via .htaccess. All other pages should work as intended, and this is specific only to the WordPress index page. Any help would really be appreciated. ! , Try this RewriteEngine On
RewriteRule ^$ https://maindomain.com/page/ [L,R]
|
allow access to one page on sub-domain, and if tried accessing other pages redirect to main domain
Date : March 29 2020, 07:55 AM
I hope this helps you . Define all your routes and after it define constraint for app subdomain. You need to match test route and use redirect for all other subdomain routes. Specify only blank subdomain in redirect parameters, in this case it will get all other info from request and only change subdomain to main domain get 'campaigns/test', to: redirect(subdomain: 'app'), constraints: { subdomain: '' }
get '/campaigns/:slug', to: 'campaigns#show'
post '/cam_enquiry', to: 'campaigns#cam_enquiry'
constraints subdomain: 'app' do
get 'campaigns/test', to: 'contoroller#action'
get '/*any', to: redirect(subdomain: '')
end
|
How to .htaccess redirect domain to subdomain while keeping the main domain intact
Date : March 29 2020, 07:55 AM
|