| ||||||||||
Shopping cart software Solutions for online shops and malls | ||||||||||
|
X-Cart Home | FAQ | Forum rules | Calendar | User manuals | Login |
Unable to get an htaccess redirect to work? | |||
|
|
Thread Tools | Search this Thread |
#1
|
|||||||
|
|||||||
Unable to get an htaccess redirect to work?
Hi guys,
I have my store setup under /shop and since I no longer want to use a cover page I was trying to redirect my primary domain to the subdirectory via htaccess. However, each variation I've attempted has resulted in the store loading but giving me a Page Not Found. As a side note to this, I have other domain redirects pointing to /shop and they work fine, it seems to only be the primary domain redirect causing this issue. For reference, I'm using XC v5.2.13 This is the basic redirect I used: RewriteCond %{HTTP_HOST} ^(www.)?url.com$ RewriteRule ^(/)?$ shop [L] And I've also tried: RewriteCond %{HTTP_HOST} ^(www.)?url.com$ RewriteCond %{REQUEST_URI} !^/shop/ RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d # Change 'subfolder' to be the folder you will use for your main domain. RewriteRule ^(.*)$ /subfolder/$1 RewriteCond %{HTTP_HOST} ^(www.)?url.com$ RewriteRule ^(/)?$ shop/ [L] Can anyone pleeeeease help with this issue? |
|||||||
#2
|
|||||||||
|
|||||||||
Re: Unable to get an htaccess redirect to work?
Why don't you just move the site in root instead of trying to redirect it like this?
__________________
Steve Stoyanov CFLSystems.com Web Development |
|||||||||
#3
|
|||||||
|
|||||||
Re: Unable to get an htaccess redirect to work?
Mostly because I expected the htaccess to be the quick and painless solution... haha
I did consider it though, was just concerned it may cause too many issues. Think that's the better option? |
|||||||
#4
|
|||||||||
|
|||||||||
Re: Unable to get an htaccess redirect to work?
Yes move it root. No need to redirects. And SE do not like redirects like this
__________________
Steve Stoyanov CFLSystems.com Web Development |
|||||||||
#5
|
|||||||
|
|||||||
Re: Unable to get an htaccess redirect to work?
Quote:
It can be .... just depends on your own Apache version / setup but it's simple to apply this: Quote:
That's the root to your shop sub-directory - easy. cflsystems advise is better longterm, but if you're currently short of time...
__________________
Dev Store & Live Store XC Business 5.4.1.35 Server; Ubuntu 22.04.2 LTS (HWE 6.2.0.26.26 Kernel)) / Plesk Obsidian Nginx 1.20.4 / Apache 2.4.52 (Ubuntu Backported) / MariaDB 10.11.4 / PHP 7.4.33 |
|||||||
#6
|
|||||||
|
|||||||
Re: Unable to get an htaccess redirect to work?
Quote:
I was in a bit of a rush, but I took CFL's advice and went ahead and did the transfer. It ended up being pretty painless thankfully. |
|||||||
|
|||
X-Cart forums © 2001-2020
|