News:

Go to HostNed.com
Welcome.  This is a place to get user-to-user support, learn more, and share ideas.  If you can't find your answers here, feel free to ask by creating a new topic or visit the support ticket system at https://my.hostned.com :)  Have fun here!

Main Menu

.htaccess

Started by Daniel, November 30, 2007, 11:37:58 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Daniel

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]

Dynaweb

Which server is your site on?

Daniel


Dynaweb

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?

Daniel

Quote from: Dynaweb 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?

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.

Daniel

Quote from: Dynaweb on December 01, 2007, 03:26:53 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.

shellnil

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.

Daniel

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


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