Ken_Shea Posted November 28, 2018 Share Posted November 28, 2018 Not sure even how to word this. If https://ontargetsportsonline.com Is entered it goes to a landing page with a link to the store https://www.ontargetsportsonline.com/catalog_ontarget/ Is it possible to automatically got to the https://www.ontargetsportsonline.com/catalog_ontarget/ I do not like having the nexessary addition of /catalog_ontarget/ but thats the way it is I guess. Thanks for any input Link to comment Share on other sites More sharing options...
♥JcMagpie Posted November 28, 2018 Share Posted November 28, 2018 Redirect requests with .htaccess RewriteEngine on RewriteCond %{HTTP_HOST} ontargetsportsonline\.com [NC] RewriteCond %{REQUEST_URI} ^/$ RewriteRule ^(.*)$ /catalog_ontarget/$1 [L] Link to comment Share on other sites More sharing options...
ArtcoInc Posted November 28, 2018 Share Posted November 28, 2018 @Ken_Shea 52 minutes ago, JcMagpie said: Redirect requests with .htaccess RewriteEngine on RewriteCond %{HTTP_HOST} ontargetsportsonline\.com [NC] RewriteCond %{REQUEST_URI} ^/$ RewriteRule ^(.*)$ /catalog_ontarget/$1 [L] This .htaccess file goes in the root of your shop (ontargetsportsonline.com). This is also where you can put the bits to force your htts status, and whether you have the www. in front of your domain, or not (as defined by how your SSL certificate was created). In your /catalog_ontarget directory, you can have another .htaccess file that just controls how your shop works. HTH M Link to comment Share on other sites More sharing options...
MrPhil Posted November 28, 2018 Share Posted November 28, 2018 Also commonly RewriteEngine on RewriteCond %{REQUEST_URI} !^/catalog_ontarget RewriteRule ^(.*)$ /catalog_ontarget/$1 [L] This assumes that your store is configured to have /catalog_ontarget in all its links. Only outside visitors who don't explicitly type in the full link get their URL modified. Note that this is not a 301 (permanent) redirect, but you could add that if you want. Link to comment Share on other sites More sharing options...
Ken_Shea Posted November 28, 2018 Author Share Posted November 28, 2018 OK, got it working, seems fine, and it got rid of that /catalog_ontarget/ upon entry to the site but does use it in all pages linked to in the site, which is fine.. MrPhil. going to try your code to see if there is any change as well, might learn something by it. Thanks so much guys Ken Link to comment Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.