Webmaster Forum


Go Back   Webmaster Forum > Web Development > Web Design Lobby > Coding Forum
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Coding Forum Problems with your code? Let's hear about it.

   

Reply
 
LinkBack Thread Tools Display Modes
Old 08-23-2006, 08:19 PM   #1 (permalink)
v7n Mentor
 
Sketch's Avatar
 
Join Date: 05-06-04
Location: London, UK
Posts: 1,454
iTrader: 0 / 0%
Latest Blog:
None

Sketch is a highly respected web proSketch is a highly respected web proSketch is a highly respected web proSketch is a highly respected web proSketch is a highly respected web proSketch is a highly respected web proSketch is a highly respected web proSketch is a highly respected web proSketch is a highly respected web proSketch is a highly respected web proSketch is a highly respected web pro
htaccess & SSL

Hey,

If someone goes to my site http://www.site.com/payment OR http://site.com/payment how can I make it automatically redirect them to https://www.site.com/payment

Do you do this via php, htaccess or some other means?

Last edited by Sketch : 08-23-2006 at 08:24 PM.
Sketch is offline  
Add Post to del.icio.us
Reply With Quote
Old 08-24-2006, 03:45 AM   #2 (permalink)
v7n Mentor
 
Sketch's Avatar
 
Join Date: 05-06-04
Location: London, UK
Posts: 1,454
iTrader: 0 / 0%
Latest Blog:
None

Sketch is a highly respected web proSketch is a highly respected web proSketch is a highly respected web proSketch is a highly respected web proSketch is a highly respected web proSketch is a highly respected web proSketch is a highly respected web proSketch is a highly respected web proSketch is a highly respected web proSketch is a highly respected web proSketch is a highly respected web pro
& Also,

I have this code;

Code:
RewriteRule ^about/$ about [R]
I just want to get rid of the slash. And it directs me to http://mysite.com/home/myusername/home/about

Why does it do this? Is there anything I can do to stop this?
Sketch is offline  
Add Post to del.icio.us
Reply With Quote
Old 08-27-2006, 11:23 AM   #3 (permalink)
Junior Member
 
themole's Avatar
 
Join Date: 03-28-06
Posts: 27
iTrader: 0 / 0%
Latest Blog:
Construction

themole is liked by somebodythemole is liked by somebodythemole is liked by somebodythemole is liked by somebody
This is how to do it via PHP, not sure how to with .htaccess.

if($_SERVER['ssl_access'] != 1 && $_SERVER['HTTPS'] != on)
header("Location: https://www.yourdomain.tld/$_SERVER[SCRIPT_URL]");

Quote:
Originally Posted by Sketch
& Also,

I have this code;

Code:
RewriteRule ^about/$ about [R]
I just want to get rid of the slash. And it directs me to http://mysite.com/home/myusername/home/about

Why does it do this? Is there anything I can do to stop this?
I know on my server, it automatically puts the trailing / on folders. I get stuck in loop when I try to redirect it because of that. This is what I was using, maybe it will work for you or get you going in the right direction:


RewriteEngine on
RewriteCond %{REQUEST_URI} ^/about/$ [NC]
RewriteRule (.*) /about


-the mole

Last edited by themole : 08-27-2006 at 11:34 AM.
themole is offline  
Add Post to del.icio.us
Reply With Quote
Old 08-28-2006, 04:12 AM   #4 (permalink)
v7n Mentor
 
Sketch's Avatar
 
Join Date: 05-06-04
Location: London, UK
Posts: 1,454
iTrader: 0 / 0%
Latest Blog:
None

Sketch is a highly respected web proSketch is a highly respected web proSketch is a highly respected web proSketch is a highly respected web proSketch is a highly respected web proSketch is a highly respected web proSketch is a highly respected web proSketch is a highly respected web proSketch is a highly respected web proSketch is a highly respected web proSketch is a highly respected web pro
Thank you mole man, I will try that now
Sketch is offline  
Add Post to del.icio.us
Reply With Quote
Go Back   Webmaster Forum > Web Development > Web Design Lobby > Coding Forum

Reply



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
htaccess Sketch Coding Forum 10 12-22-2005 08:24 AM
.htaccess sim Coding Forum 5 01-24-2005 03:54 PM
What can you do with .htaccess? Jason Web Design Lobby 4 12-03-2004 11:39 PM
.htaccess help Limit Coding Forum 1 08-07-2004 11:34 AM
.htaccess Pimpen 2010 Coding Forum 15 10-21-2003 02:39 PM


Sponsor Links
Webmaster Forum Get exposure! Find Scripts Web Hosting Directory Get exposure! SEO Blog


All times are GMT -7. The time now is 03:48 AM.
© Copyright 2008 V7 Inc