You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Alberto García Gómez <al...@ipimtzcm.rimed.cu> on 2007/11/01 16:21:09 UTC

[users@httpd] Re: [***SPAM*** Score/Req: 10.4/5.0] Re: [users@httpd] APACHE mod_rewrite

Hi Joshua and fellows:

Here's my problem indeed:

I working in a website and I trying to make this website full SEO. Now 
actually I'm pasing all parameters to the server in this way:

1.-  http://www.myserver.com/?param1/param2/param3.html

But I want to pass the parameters in this way:

2.-  http://www.myserver.com/param1/param2/param3.html

So to users and search engines the above URI will be the (2), but the to the 
Apache must be the (1)

I hope you can help me.

my best regards.

----- Original Message ----- 
From: "Joshua Slive" <jo...@slive.ca>
To: <us...@httpd.apache.org>
Sent: Thursday, November 01, 2007 11:22 AM
Subject: [***SPAM*** Score/Req: 10.4/5.0] Re: [users@httpd] APACHE 
mod_rewrite


On Oct 31, 2007 4:04 PM, Alberto García Gómez <al...@ipimtzcm.rimed.cu> 
wrote:
>
>
> I have this URL
>
> http://www.myserver.com/dir1/dir2/page.html
>
> and I wish to rewrite the url using mod_rewrite to add a ~ after the first
> dir always, eg.:
>
> http://www.myserver.com/~dir1/dir2/page.html
>
> Please it's very important to make this ASAP

The question is not well specified. Do you want to change what the
users see or what apache tries to access? Tell us exactly what you
want people to type in their browser (or html links) and exactly what
you want apache to do when it receives the request.

Joshua.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org



Este correo ha sido enviado desde el Politécnico de Informática "Carlos Marx" de Matanzas.
"La gran batalla se librará en el campo de las ideas"



---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Re: [***SPAM*** Score/Req: 10.4/5.0] Re: [users@httpd] MOD_REWRITE

Posted by Joshua Slive <jo...@slive.ca>.
On Nov 1, 2007 4:17 PM, Alberto García Gómez <al...@ipimtzcm.rimed.cu> wrote:
> Joshua:
>
> My deepest apologies for my faults, I promisse you don't do it again.
>
> Now it's working fine, I really apreciate this help.

No need to apologize. Glad it's working.

Joshua.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


[users@httpd] Re: [***SPAM*** Score/Req: 10.4/5.0] Re: [users@httpd] MOD_REWRITE

Posted by Alberto García Gómez <al...@ipimtzcm.rimed.cu>.
Joshua:

My deepest apologies for my faults, I promisse you don't do it again.

Now it's working fine, I really apreciate this help.

best regards.

----- Original Message ----- 
From: "Joshua Slive" <jo...@slive.ca>
To: <us...@httpd.apache.org>
Sent: Thursday, November 01, 2007 03:44 PM
Subject: [***SPAM*** Score/Req: 10.4/5.0] Re: [users@httpd] MOD_REWRITE


On Nov 1, 2007 2:17 PM, Alberto García Gómez <al...@ipimtzcm.rimed.cu> 
wrote:
> Joshua, please check the result log (attach it) for a single request of a
> page. Off course I do this:
>
> http://myserver.com/page.html
>
> but nothing return, otherwise if I request:
>
> http://myserver.com/?page.html
>
> it works

A few notes here:

1. Don't start new threads. Reply to the old message so that
everything groups together for threaded mail programs.

2. Don't just attach your log. Open it up and paste in what you think
is the part relevant to solving the problem. (This ain't a log
debugging service, it's a discussion forum.)

3. You don't appear to have RewriteLogLevel up very high.

4. Obviously the rewrite is looping due to the way your config is
setup. This might work better:

RewriteRule ^/(.*\.html)$ /usr/local/apache2/htdocs/index.php?$1

Obviously I'm just guessing about the true path to the php script.

Joshua.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org



Este correo ha sido enviado desde el Politécnico de Informática "Carlos Marx" de Matanzas.
"La gran batalla se librará en el campo de las ideas"



---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] MOD_REWRITE

Posted by Joshua Slive <jo...@slive.ca>.
On Nov 1, 2007 2:17 PM, Alberto García Gómez <al...@ipimtzcm.rimed.cu> wrote:
> Joshua, please check the result log (attach it) for a single request of a
> page. Off course I do this:
>
> http://myserver.com/page.html
>
> but nothing return, otherwise if I request:
>
> http://myserver.com/?page.html
>
> it works

A few notes here:

1. Don't start new threads. Reply to the old message so that
everything groups together for threaded mail programs.

2. Don't just attach your log. Open it up and paste in what you think
is the part relevant to solving the problem. (This ain't a log
debugging service, it's a discussion forum.)

3. You don't appear to have RewriteLogLevel up very high.

4. Obviously the rewrite is looping due to the way your config is
setup. This might work better:

RewriteRule ^/(.*\.html)$ /usr/local/apache2/htdocs/index.php?$1

Obviously I'm just guessing about the true path to the php script.

Joshua.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


[users@httpd] MOD_REWRITE

Posted by Alberto García Gómez <al...@ipimtzcm.rimed.cu>.
Joshua, please check the result log (attach it) for a single request of a 
page. Off course I do this:

http://myserver.com/page.html

but nothing return, otherwise if I request:

http://myserver.com/?page.html

it works


Este correo ha sido enviado desde el Politécnico de Informática "Carlos Marx" de Matanzas.
"La gran batalla se librará en el campo de las ideas"

Re: [users@httpd] Re: [***SPAM*** Score/Req: 10.4/5.0] Re: [users@httpd] APACHE mod_rewrite

Posted by Joshua Slive <jo...@slive.ca>.
On Nov 1, 2007 1:05 PM, Alberto García Gómez <al...@ipimtzcm.rimed.cu> wrote:
> Joshua:
>
> I place the directives in both VirtualHost and in the .htaccess file and
> nothing happen, ins't working.

Turn on the RewriteLog at a nice high RewriteLogLevel.

Those directives belong inside the <VirtualHost> section but outside
any <Directory> section (or .htaccess file). You'll also need to
restart the server, of course.

And go read the mod_rewrite docs. Yes, it's a nightmare. But
otherwise, you're just going to be guessing.

Joshua.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Re: [***SPAM*** Score/Req: 10.4/5.0] Re: [users@httpd] APACHE mod_rewrite

Posted by Alberto García Gómez <al...@ipimtzcm.rimed.cu>.
Joshua:

I place the directives in both VirtualHost and in the .htaccess file and 
nothing happen, ins't working.

----- Original Message ----- 
From: "Joshua Slive" <jo...@slive.ca>
To: <us...@httpd.apache.org>
Sent: Thursday, November 01, 2007 01:07 PM
Subject: Re: [users@httpd] Re: [***SPAM*** Score/Req: 10.4/5.0] Re: 
[users@httpd] APACHE mod_rewrite


On Nov 1, 2007 11:21 AM, Alberto García Gómez <al...@ipimtzcm.rimed.cu> 
wrote:
> Hi Joshua and fellows:
>
> Here's my problem indeed:
>
> I working in a website and I trying to make this website full SEO. Now
> actually I'm pasing all parameters to the server in this way:
>
> 1.-  http://www.myserver.com/?param1/param2/param3.html
>
> But I want to pass the parameters in this way:
>
> 2.-  http://www.myserver.com/param1/param2/param3.html
>
> So to users and search engines the above URI will be the (2), but the to 
> the
> Apache must be the (1)

As search engines get smarter, this kind of optimization matters less
and less, but anyway:

RewriteEngine On
RewriteRule ^/(.*\.html) /?$1 [L]

This assumes you want the full path injected in the query string if
and only if it ends in html. Other specific restrictions could easily
be added with addition RewriteRules.

Joshua.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org



Este correo ha sido enviado desde el Politécnico de Informática "Carlos Marx" de Matanzas.
"La gran batalla se librará en el campo de las ideas"



---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Re: [***SPAM*** Score/Req: 10.4/5.0] Re: [users@httpd] APACHE mod_rewrite

Posted by Joshua Slive <jo...@slive.ca>.
On Nov 1, 2007 11:21 AM, Alberto García Gómez <al...@ipimtzcm.rimed.cu> wrote:
> Hi Joshua and fellows:
>
> Here's my problem indeed:
>
> I working in a website and I trying to make this website full SEO. Now
> actually I'm pasing all parameters to the server in this way:
>
> 1.-  http://www.myserver.com/?param1/param2/param3.html
>
> But I want to pass the parameters in this way:
>
> 2.-  http://www.myserver.com/param1/param2/param3.html
>
> So to users and search engines the above URI will be the (2), but the to the
> Apache must be the (1)

As search engines get smarter, this kind of optimization matters less
and less, but anyway:

RewriteEngine On
RewriteRule ^/(.*\.html) /?$1 [L]

This assumes you want the full path injected in the query string if
and only if it ends in html. Other specific restrictions could easily
be added with addition RewriteRules.

Joshua.

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org