HostNed.comHostNed Forums
Welcome, Guest. Please login or register.
Did you miss your activation email?
July 25, 2008, 03:43:34 AM
248 Posts in 90 Topics by 65 Members
Latest Member: apurvis
Home Help Search Login Register
HostNed Forums  |  WEB HOSTING  |  Linux Hosting  |  Topic: .htaccess 0 Members and 1 Guest are viewing this topic. « previous next »
Pages: [1] Print
Author Topic: .htaccess  (Read 1406 times)
Daniel
Newbie
*
Posts: 9


View Profile
.htaccess
« on: November 30, 2007, 11:37:58 AM »

I was wondering if the ReWriteEngine was active. The following lines don't seem to be working as expected
(redirecting people trying to access

http://mydomain.com/imprimir/tabla-romanos.pdf

to

http://mydomain.com/imprimir/numeros-romanos.html

and so on.
)

Options -Indexes
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\.)?mydomain.com/.*$ [NC]
RewriteRule tabla-romanos.pdf$ http://mydomain.com/imprimir/numeros-romanos.html [R,L]

RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\.)?mydomain.com/.*$ [NC]
RewriteRule tablas-de-multiplicar.pdf$ http://mydomain.com/logo/tablas-de-multiplicar.html [R,L]

RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\.)?mydomain.com/.*$ [NC]
RewriteRule ejercicios-multiplicacion.pdf$ http://mydomain.com/imprimir/ejercicios-multiplicacion.html [R,L]
Logged
Dynaweb
Yep
Administrator
Full Member
*****
Gender: Male
Posts: 107


HostNed Admin


View Profile WWW
Re: .htaccess
« Reply #1 on: November 30, 2007, 01:35:32 PM »

Which server is your site on?
Logged
Daniel
Newbie
*
Posts: 9


View Profile
Re: .htaccess
« Reply #2 on: November 30, 2007, 09:52:42 PM »

Which server is your site on?

70.84.212.26
Logged
Dynaweb
Yep
Administrator
Full Member
*****
Gender: Male
Posts: 107


HostNed Admin


View Profile WWW
Re: .htaccess
« Reply #3 on: December 01, 2007, 03:26:53 AM »

Mod_rewrite is active and functional on that server.  Are the rules you have active axactly as you posted here or is that just a generic example?
Logged
Daniel
Newbie
*
Posts: 9


View Profile
Re: .htaccess
« Reply #4 on: December 01, 2007, 08:24:06 AM »

Mod_rewrite is active and functional on that server.  Are the rules you have active axactly as you posted here or is that just a generic example?

Currently no,

they are:

RewriteEngine on
Options -Indexes

RewriteCond %{HTTP_REFERER} !^http://(www\.)?mydomain.com/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://(www\.)?mydomain.com$      [NC]
RewriteRule .*\.(pdf)$ http://mydomain.com/imprimir/ [R,NC]
 

But I prefer to have the ones I posted in my first post, because they are specific. They didn't work.
Logged
Daniel
Newbie
*
Posts: 9


View Profile
Re: .htaccess
« Reply #5 on: December 01, 2007, 08:25:48 AM »

Are the rules you have active axactly as you posted here or is that just a generic example?

the only difference is that I use the actual name of my domain.
Logged
shellnil
Newbie
*
Posts: 1


View Profile
Re: .htaccess
« Reply #6 on: December 04, 2007, 12:27:44 PM »

Hello,

I have checked the rules provided by you. Can I get the URL where you are getting error and the errors. Also I want to complete rules with real domain name so that I'll investigate the issue further.

Thank You.
Logged
Daniel
Newbie
*
Posts: 9


View Profile
Re: .htaccess
« Reply #7 on: December 04, 2007, 08:04:41 PM »

Yes, I guess there isn't any problem with publishing that information, the actual file is:

Code:
RewriteEngine on
Options -Indexes

RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\.)?neoparaiso.com/.*$ [NC]
RewriteRule ejercicios-multiplicacion.pdf$ http://neoparaiso.com/imprimir/ejercicios-multiplicacion.html [R,L]

RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\.)?neoparaiso.com/.*$ [NC]
RewriteRule tabla-romanos.pdf$ http://neoparaiso.com/imprimir/numeros-romanos.html [R,L]

RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://(www\.)?neoparaiso.com/.*$ [NC]
RewriteRule tablas-de-multiplicar.pdf$ http://neoparaiso.com/logo/tablas-de-multiplicar.html [R,L]



the problem is that, using those rules, when I type in the address bar of the browser something like:


http://neoparaiso.com/logo/tablas-de-multiplicar.pdf

The browser downloads the pdf instead of redirecting to the

http://neoparaiso.com/logo/tablas-de-multiplicar.html
Logged
Pages: [1] Print 
HostNed Forums  |  WEB HOSTING  |  Linux Hosting  |  Topic: .htaccess « previous next »
Jump to: