Magento redirecting secure www to secure non www - magento

My site used to auto redirect from http://www.petpresto.com.au/ to http://petpresto.com.au/ which was great. Both addresses resolved fine, worked perfectly, and redirected as needed.
Then I decided to change the entire site over to secure https.
Now both http://www.petpresto.com.au/ and http://petpresto.com.au/ redirect to https://petpresto.com.au/ (I think this is done by Magento automatically - which is great) but https://www.petpresto.com.au/ does not resolve at all and I don't know how to make it also redirect to https://petpresto.com.au/?
My SSL cert is valid for both www and non www.

hellp,please the code in htacess file this
RewriteCond %{HTTPS} on
RewriteCond %{HTTP_HOST} ^www\.
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI}$1
Also,you secure url must be https://petpresto.com.au/.Please check this in admin setting system>configuration>General>Web

Related

Change Laravel app on shared hosting root directory

We have an added domain on a shared hosting. This domain is not the main hosting domain, but an added one that points to directory that matches the domain. The app was installed with a one click installer inside a dir like
ourdomain.com and Laravel public directory is accessed like
ourdomain.com/public
I need to use .htaccess to make /public the root of ourdomain.com and at the same time /public, so the project files and folders are protected as well. Can someone help show me how to do this with .htaccess?
If you do not have the access to change the settings in anything like CPANEL or similar then you can do it like this via .htaccess
RewriteEngine on
RewriteCond %{HTTP_HOST} ^ourdomain.com$ [NC,OR]
RewriteCond %{HTTP_HOST} ^www.ourdomain.com$
RewriteCond %{REQUEST_URI} !public/
RewriteRule (.*) /public/$1 [L]

Magento 404 front end on Multi Site after moving server

We have recently moved a Magento multi site environment to a new dedicated server, however all the sites apart from the admin URL site (not used apart from admin are) are reporting Magento style 404 pages on the front end.
We have ensured mod_rewrite is turned on, checked the database and manually amended the URLs in PHPMyAdmin to assign some temporary test URLs. The URL assigned to the admin area works fine, and the rest resolve to the server, however every front end is still 404. We have tried adding in index.php to the URL, no change. Checked all file and folder permissions, all OK. Cleared all cache manually and reindexed from command line. No change.
We have checked HTACCESS is correct which it looks to be. We have even taken another backup of the database and full site and restored to another server with the same issues.
We have also tried disabling SEO urls/URL Rewrites without change too.
Error logs dont say a lot either which isnt helpful.
Really struggling with this now so any help or pointers greatly appreciated. Thanks
First Solution:
Replace current .htaccess file with the default .htaccess file from Magento.
Second Solution:
#fastcgi_param MAGE_RUN_CODE default;
If doesn't work, try following solution:
Third Solution:
Is this installed on an Apache webserver? If not, the .htaccess functions will need to be translated to your flavor of web server software.
Has DSO module for mod_rewrite been installed in Apache and been enabled to load?
Is AllowOverrides enabled for the virtual server so Options +FollowSymLinks will function? You may have to check with your hosting service provider and have it enabled.
Is Magento's .htaccess file available in the doc root folder?
Has the rewrite engine been turned on in the .htaccess file?
Has the proper RewriteBase been assigned in the .htaccess file?
General entries in Magento's .htaccess that must function so rewrites will function to eliminate the need for index.php to appear in the URL.
<IfModule mod_rewrite.c>
############################################
## enable rewrites
Options +FollowSymLinks
RewriteEngine on
############################################
## you can put here your magento root folder
## path relative to web root
#RewriteBase /magento/
############################################
## workaround for HTTP authorization
## in CGI environment
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
############################################
## always send 404 on missing files in these folders
RewriteCond %{REQUEST_URI} !^/(media|skin|js)/
############################################
## never rewrite for existing files, directories and links
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
############################################
## rewrite everything else to index.php
RewriteRule .* index.php [L]
</IfModule>
Third solution from Fiasco Labs

Object not found error 404 in codeigniter

i have some problem when i try to open another controller
http://localhost/ci/dashboard
getting error like this:
Object not found!
The requested URL was not found on this server. If you entered the URL manually please check your spelling and try again.
If you think this is a server error, please contact the webmaster.
Error 404
localhost
Apache/2.4.4 (Win32) OpenSSL/0.9.8y PHP/5.4.19
link sourcecode: sourcecode
If you Using WAMP server then open "httpd.conf" file, search "LoadModule rewrite_module modules/mod_rewrite.so" and remove # which in the start of the same line..
and restart your WAMP Server
Then add this code to your .htaccess file which is in the codeigniter folder (if not create it in the folder's root):
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php/$0 [PT,L]
check first if apache is already way or not
and may try to open localhost port problem
and usually when in the ci enksripsi effect to open a web page

mod_rewrite issues with something that used to work

I have a virtual private server that was borked over the weekend, and has been upgraded. Sometime between now and then, some changes have been made that have impacted a mod_rewrite call, but I'm not sure which.
In any event, I have a folder with a PHP script that emulates a CAS server. The system used to work fine and dandy until today. Now, instead of the mod_rewrite directives providing commands via rewrite to the index.php file, Apache goes '404' and sends me up a directory to Wordpress's 404 handler.
This is the htaccess code that used to work:
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
RewriteEngine On
RewriteRule ^([A-Za-z0-9-]+)/?$ index.php?mode=$1 [QSA, L]
The URL variables appeared in CAS-appropriate commands (like cas/login, cas/logout), but are now generating 404s.
There may have been Apache tweaking; do I need to add any commands to the htaccess (like Options Indexes) or something to make Apache listen to the rewrite commands?
Oddly, the force-https command seems to work.

Apache mod_rewrite does not work

Im using a J2ee application with spring framework 2.0 on a apache tomcat 5.5. I have used URL mapping to change the extension from .jsp to .htm. I have an URL which looks like this
http://www.800promotion.com/promotion.htm?cid=1344159422528120632840257756098788
I want to change it to
http://www.800promotion.com/1344159422528120632840257756098788
I have referred samples of working on mod_rewrite. However I cant seem to get it working. These are the lines in my .htaccess file.
RewriteEngine on
RewriteRule ^([^/.]+)/?$ /promotion.htm?cid=$1 [L]
I have checked with my host and they said mod_rewrite was supported on the server. I do not have access to the httpd.conf file. However I have verified from the support that AllowOverride is set to all. When I hit the URL the page works fine however the URL doesnt get mapped. Where am I going wrong?
RewriteEngine On
RewriteRule ^(.+)$ promotion.htm?cid=$1 [QSA,L]
Try this
You need a correct .htaccess directives. Try the following solution:
RewriteEngine on
RewriteBase /
RewriteRule (.*) promotion.htm?cid=$1 [L,I,U]

Resources