0

I added an SSL to my website and have redirected all files to https through .htaccess as I have attached the code.
My issue is if someone clicks a backlink of mine that has http Eg. http://www.example.com/example/example it redirects to https://www.example.com/plus.php which takes you to my homepage. Without http and just www or non www it redirects fine. I don't want to add my website name as spam but if it is helpful to see the issue the site is SexiestPicture.com Everything else works properly any help would be great thank you.

My .htaccess is `Allow from all DirectoryIndex plus.php index.php index.htm index.html RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . plus.php [L] RewriteEngine On RewriteCond %{HTTPS} off RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] RewriteCond %{HTTP_USER_AGENT} libwww-perl.* RewriteRule .* ? [F,L]`
  • are you using apache? if so please show how your `virtualhost` file is set up, the default for apache is `/etc/apache2/sites-enabled/000-default.conf` – Jpsh Apr 05 '17 at 21:15
  • Under virtual host it just says Powered by vesta I set up the SSL through my vestacp – Mark Young Apr 05 '17 at 21:37
  • @user3299379 Under virtual host it just says Powered by vesta I set up the SSL through my vestacp – Mark Young Apr 05 '17 at 21:50
  • can you provide more information about your environment and what how you installed apache? for example what package or suite did you install – Jpsh Apr 05 '17 at 22:04
  • @user3299379 Debian 7 32bit with VestaCP control panel does that help? The website uses a script which is why there is a file plus.php so any page on my site if http is typed it goes to that page I'm not sure why is there a way to force http to go to https – Mark Young Apr 05 '17 at 22:09
  • @user3299379 Im assuming that RewriteRule . plus.php [L] on my htaccess file has something to do with it but that part is needed – Mark Young Apr 05 '17 at 22:11
  • is there a file at `/etc/apache2/sites-available/` ? if so it should contain virtual hosts. it's best practice to use method to redirect – Jpsh Apr 05 '17 at 22:15
  • possible duplicate http://stackoverflow.com/questions/13376219/htaccess-redirect-http-to-https – Jpsh Apr 05 '17 at 22:15
  • @user3299379 there is a file and it contains this ../ default default-ssl .swp – Mark Young Apr 05 '17 at 22:21
  • please post content of 000-default.conf or default.conf virtual host. also look at this question it should answer yours http://stackoverflow.com/questions/13376219/htaccess-redirect-http-to-https – Jpsh Apr 05 '17 at 22:24
  • Possible duplicate of [.htaccess redirect http to https](http://stackoverflow.com/questions/13376219/htaccess-redirect-http-to-https) – Jpsh Apr 05 '17 at 22:25

0 Answers0