Today's Messages (OFF)  | Unanswered Messages (ON)

Forum: Htaccess Questions
 Topic: redirected to /401.shmtl with .htpasswd & SSL force higher up
icon6.gif  redirected to /401.shmtl with .htpasswd & SSL force higher up [message #961] Thu, 28 August 2008 01:09
rupertrealbear  is currently offline rupertrealbear
Messages: 1
Registered: August 2008
Location: Hertfordshire, England
Hi

I set up a .htpasswd file in the root of my account on a VPS and put a .htaccess in a sub folder /public-html/hq containing a directives to password protect this folder:-
AuthName "Restricted Area" 
AuthType Basic 
AuthUserFile /home/charlie/.htpasswd 
AuthGroupFile /dev/null 
require valid-user
When there is also a .htaccess higher up, in the /public-html folder forcing SSL on all requests (always on, throughout the site):-
 . . .

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
. . . I generally get directed to some default (and non-existent) error document "/401.shmtl".
When in a page in the sub folder /public-html/hq, [which happens to post to itself] I do get the password popup - and also if I revisit a cached call to a https:// URL in that folder.

The situation was un-liveable, though I have moved the 'force SSL' directives into the .htacess in /public-html/hq:-
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
AuthName "Restricted Area" 
AuthType Basic 
AuthUserFile /home/charlie/.htpasswd 
AuthGroupFile /dev/null 
require valid-user
This actually asks for the password TWICE (before and after conversion of the request into htpps://)
I suppose I could bare having to subject the user to this.
I just wondered if there was some workaround - like having the .htpasswd only apply to https ? (or maybe some other subtle solution ?)

Suggestions would be much appreciated

Many thanks

Guy Hackney
 Topic: Going round in circles
Going round in circles [message #960] Tue, 26 August 2008 17:43
keithhulse  is currently offline keithhulse
Messages: 1
Registered: August 2008
Hi, a client has a .co.uk address and a .com address for the same company. The .co.uk is an alias to the .com in case anyone types .co.uk by mistake.

At the moment then if a user type companyname.co.uk they are looking at companyname.com but the url is displayed in the address bar as .co.uk

The client wants to change this so that if a user types in the .co.uk they of course will see the .com site but he wants the .com url to appear in the address bar.

I have been informed that a .htaccess file is best for this but I can't get my head around how to do it without creating an infinite loop.

I would appreciate some clear thinking Smile

Many thanks,
Keith Hulse
 Topic: htaccess file
htaccess file [message #959] Sun, 24 August 2008 04:02
newkid90
Messages: 1
Registered: August 2008
I have created a website using bravenet. They tell me to create a htaccess file upload it and then use it to overwrite a file. I dont have a great deal of knowledge on this subject. How do i create the file and what do i overwrite with it. it would really help if someone could help me with it in laymans terms as i am not really a techie
thanks
ceedee
 Topic: Help me hide a subfolder
Help me hide a subfolder [message #958] Mon, 18 August 2008 22:32
jaunty_mellifluous  is currently offline jaunty_mellifluous
Messages: 1
Registered: August 2008
Hi,

I've set up a site of mine here, http://www.roadsout.com. I've set it up so that the main folder for the site is 'roadsout' which is a subfolder in the root folder.

I'm using this .htaccess to make this happen.

Code:
RewriteEngine on


Options +FollowSymlinks
RewriteBase /
RewriteCond %{HTTP_HOST} roadsout.com
RewriteCond %{REQUEST_URI} !roadsout/
RewriteRule ^(.*)$ roadsout/$1 [L]


RewriteCond %{HTTP_REFERER} !^http://www.roadsout.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.roadsout.com$ [NC]
RewriteRule .*\.(.*.*.*jpg|jpeg|gif|png|bmp)$ http://www.roadsout.com [R,NC]

RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} !^/roadsout.*$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]




It works, but when I click on some links on my site, it starts showing the subfolder inside my site too, for example,

http://www.roadsout.com/roadsout/index. ... e&Itemid=1

Can you give me some .htaccess code that will permanently hide that folder from showing up in my site's links?

Why do I want to make a subfolder and run it like that? Because it makes it easier for me to manage my folders and doesn't make a mess of things. Plus I want to host other sites too, so each site will have it's own folder which will be easy to manage.
 Topic: redirect domain/page.html to subdomain/page.html
redirect domain/page.html to subdomain/page.html [message #957] Fri, 15 August 2008 01:41
sniperfora  is currently offline sniperfora
Messages: 1
Registered: August 2008
hello
I have some page on domain/
and want to redirect it to subdomain/
I don’t want redirect domain to subdomain just redirect some page on domain/ to subdomain/


also is there any way to do that for a lot of page?


thanks in advance
 Topic: How to make .htaccess for ssl login page and redirect to http after login
How to make .htaccess for ssl login page and redirect to http after login [message #956] Thu, 07 August 2008 09:53
taicyber  is currently offline taicyber
Messages: 1
Registered: August 2008
Below is my folder structure
When user comes to

1. "/mysite" the index.php in mysite will redirect to /mysqite/data/modules/mysite1/interfaces/login.php
So I made .htaccess here

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}

2. login.php page
<form class="loginForm" action="../../../../login_trainee.php" method="POST" id="Login">

The data of user should be encrypted and send to login_trainee.php which is in "/mysite"
I think I have to make .htaccess for "/interfaces" but the problem is
after login user should return to use http in the rest of site even if in "/interfaces" too.

Before login : https..../mysqite/data/modules/mysite1/interfaces/login.php
After login : http...../mysqite/data/modules/mysite1/interfaces/index.php

Anyone have some idea about this?
thank you
 Topic: Dropping the file extension
Dropping the file extension [message #955] Wed, 06 August 2008 11:54
AbuAaminah  is currently offline AbuAaminah
Messages: 1
Registered: August 2008
Whilst reading Mozilla's documentation style guide, I came across this:

Quote:

Drop the file extension when linking to files on developer.mozilla.org. This way we can change the format of a file without changing the content. Also, files can expand to become directories later on.


I think that suggestion is absolutely excellent and am wondering how it can be implemented. Of course, .htaccess if involved, so perhaps you can help.

Thanks in advance.
 Topic: Redirect to requested files folder
icon5.gif  Redirect to requested files folder [message #948] Sun, 03 August 2008 11:41
harvey  is currently offline harvey
Messages: 1
Registered: July 2008
I am trying to redirect some of the pages on my website but these pages are placed all over the place. I would like to redirect the user to its respective folder, where an index file is already serving the purpose i.e.

user types: www.domain.com/multimedia/rock/playlist.xml
redirect to: www.domain.com/multimedia/rock/

user types: www.domain.com/multimedia/rock/1/2/3/1/playlist.xml
redirect to: www.domain.com/multimedia/rock/1/2/3/1/

user types: www.domain.com/multimedia/rock/1/anotherfolder/3/1/playlist. xml
redirect to: www.domain.com/multimedia/rock/1/anotherfolder/3/1/


and so on. As you have guessed, I am trying to redirect access from playlist.xml files to their respective folders. this is because my playlists are being indexed in the google and users wold not be able to understand them because these files only contain links in a text format. Also I do not wish to block these playlist from being indexed because more search results are matching my website because of these playlist.xml files.

I would really appreciate if someone could provide me with a sort of regular expression that can be applied.

[Updated on: Sun, 03 August 2008 11:43]

 Topic: Blocking a certain referrer and redirecting them.
Blocking a certain referrer and redirecting them. [message #947] Thu, 31 July 2008 22:57
bfsog  is currently offline bfsog
Messages: 1
Registered: July 2008
Location: UK
Hey, I am hoping you guys and girls can help me.

What I am trying to do is this

1) Check the referrer for a certain domain.
2) If that referrer is found, redirect the user to another website.

The code I have redirects ALL users to the RewriteRule URL. I am at a loss as to what to do next.

So in short, when a user goes to www.site.com (or any file underneath that such as www.site.com/folder) if the referrer is google.co.uk I want them to go www.anothersite.com

What am I doing wrong?

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^http://google.co.uk/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://google.co.uk$ [NC]
RewriteRule .*\.(.*)$ http://anothersite.com/ [R,NC]

[Updated on: Thu, 31 July 2008 22:58]

 Topic: Securing my videos through .htaccess
Securing my videos through .htaccess [message #945] Wed, 09 July 2008 09:40
svvs  is currently offline svvs
Messages: 1
Registered: July 2008
I am new to .htaccess and I want some help.

I have created a website for a client that wants to upload videos and visitors have to pay to view the videos. The problem that I have is the following. I am using PHP, MySql and Linux Server and when the visitor pays and and clicks on the link to see the videos, if he goes to view source from his explorer he can see the path of the video so he can download them without paying.

I want someone to help me with the .htaccess commands to allow the videos to play in the explorer only through a php script and not allow the videos to be downloaded or viewed directly in the explorer if anyone knows the excact path of the video.
 Topic: Proper syntax to use RedirectMatch to redirect to new folder
Proper syntax to use RedirectMatch to redirect to new folder [message #944] Sat, 05 July 2008 02:03
Ralph  is currently offline Ralph
Messages: 1
Registered: July 2008
I have a very limited knowledge of .htaccess, I have taken over webhosting an established site, the original webmaster just dumped everything in the root folder and it is a jumbled mess of gif,jpg,html files, all of which the owner wants to keep on the site. What I would like to do is move all the image files to an image folder and use a redirect in the htaccess file.

I have tried several strings I have found on different forums that were doing similar requests but none of them seem to work on my server, or I don't have the right syntax.

Basically what I want to do is moved all the old jpg/gif files to a folder named 'old_img' and do a simular folder for 'old_html'

If any one could give me the correct syntax it would be appreciated, I have tried:

RedirectMatch (.*)\.gif$ http://www.mysite/old_img/$1.gif

RedirectMatch 301 /(*.gif) http://www.mysite/old_img/$1

RedirectMatch (.*)\.gif$ http://www.mysite/old_img/$1.gif


Thanks beforehand for any help.
 Topic: Hotlink Protection in Firefox and Safari
Hotlink Protection in Firefox and Safari [message #943] Wed, 25 June 2008 02:19
ericp20  is currently offline ericp20
Messages: 1
Registered: June 2008
Hi,
Because people use to link directly to my swf files, I enabled the hotlink protection from the website cpanel, however if in IE7 everything is fine, the html pages do not work properly in Firefox and are not displayed at all in Safari.
Any idea to protect my files and get them properly viewed in Firefox and Safari?
Is this possible to make special rule in a htaccess file for Firefox?
thank you
 Topic: Message bodies lost
icon4.gif  Message bodies lost [message #942] Tue, 24 June 2008 12:52
andreas  is currently offline andreas
Messages: 240
Registered: January 2005
Location: Denmark

Site Admin
Unfortunately I have lost the message bodies for all threads during an upgrade of the forum software. Embarassed

Im soo fucking stupid. Argh!

Anyway, I hope you guys will still continue to use the forum.
 Topic: .htaccess help for dynamic URL rewrite
.htaccess help for dynamic URL rewrite [message #939] Sun, 11 May 2008 16:35
smm18951  is currently offline smm18951
Messages: 1
Registered: May 2008
Location: online at woocha.com
No Message Body
 Topic: 404 (Not found) error - using the .htacess on Zeus servers
404 (Not found) error - using the .htacess on Zeus servers [message #905] Sat, 22 March 2008 10:45
lister  is currently offline lister
Messages: 1
Registered: March 2008
Location: London
No Message Body
Pages (9): [1  2  3  4  5  6  7  8  9    »]


Current Time: Thu Aug 28 02:52:06 CEST 2008

Powered by: FUDforum 2.7.7.
Copyright ©2001-2007 FUD Forum Bulletin Board Software<\ /a>