You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Dwayne Tharpe <dt...@unc.edu> on 2006/06/29 20:08:08 UTC

[users@httpd] .htaccess error URGENT

Hi all,

I'm new to this and have never used mod-rewrite before or used regular 
expressions.

We have a need to mod_rewrite a link.  Below is what I'm using in a 
.htaccess file:

RewriteEngine on
Options FollowSymLinks
RewriteRule ^overview$ /guide/index.cfm?item=Chapter&Chapter_ID=C342 [L]

The problem is that "overview" is the name of a subdirectory under 
guide, so I get an error (403 I think)
when it tries to rewrite. I can't rename the subdirectory and the users 
are demanding that they be able to use just the word "overview" as a 
hyperlink.

Any suggestions? And I'm under a major time constraint :(

Thanks in advance,
Dwayne

-- 
Dwayne Tharpe
Applications Analyst Programmer II
Highway Safety Research Center @ UNC
919.843.4963





---------------------------------------------------------------------
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] .htaccess error URGENT

Posted by Dwayne Tharpe <dt...@unc.edu>.
I tried that but no luck.  I thought there would be something that I 
could use to just tell it ignore that it's a subdirectory name and go 
ahead with the re-write.

Dwayne

Andy Buckley wrote:
> Joshua Slive wrote:
>> On 6/29/06, Dwayne Tharpe <dt...@unc.edu> wrote:
>>> Hi all,
>>>
>>> I'm new to this and have never used mod-rewrite before or used regular
>>> expressions.
>>>
>>> We have a need to mod_rewrite a link.  Below is what I'm using in a
>>> .htaccess file:
>>>
>>> RewriteEngine on
>>> Options FollowSymLinks
>>> RewriteRule ^overview$ /guide/index.cfm?item=Chapter&Chapter_ID=C342 
>>> [L]
>>>
>>> The problem is that "overview" is the name of a subdirectory under
>>> guide, so I get an error (403 I think)
>>> when it tries to rewrite. I can't rename the subdirectory and the users
>>> are demanding that they be able to use just the word "overview" as a
>>> hyperlink.
>>>
>>> Any suggestions? And I'm under a major time constraint :(
>>
>> What does the error log say?  What does the RewriteLog say?
>>
>> The easist way to do this would be to put the RewriteRule in the main
>> server config rather than in .htaccess.  Then you can simply use
>> RewriteRule ^/guide/overview$ 
>> /guide/index.cfm?item=Chapter&Chapter_ID=C342 [L]
>
> Otherwise, as you're using a .htaccess file, you probably need to add a
> "RewriteBase /guide" statement. Otherwise you get into a sort of
> chicken/egg scenario about the order of resolving URLs to bits of the
> filesystem: see the bit at the top of the mod-rewrite docs for more info.
>
> Andy
>
>
>
> ---------------------------------------------------------------------
> 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

-- 
Dwayne Tharpe
Applications Analyst Programmer II
Highway Safety Research Center @ UNC
919.843.4963





---------------------------------------------------------------------
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] .htaccess error URGENT

Posted by Andy Buckley <an...@durham.ac.uk>.
Joshua Slive wrote:
> On 6/29/06, Dwayne Tharpe <dt...@unc.edu> wrote:
>> Hi all,
>>
>> I'm new to this and have never used mod-rewrite before or used regular
>> expressions.
>>
>> We have a need to mod_rewrite a link.  Below is what I'm using in a
>> .htaccess file:
>>
>> RewriteEngine on
>> Options FollowSymLinks
>> RewriteRule ^overview$ /guide/index.cfm?item=Chapter&Chapter_ID=C342 [L]
>>
>> The problem is that "overview" is the name of a subdirectory under
>> guide, so I get an error (403 I think)
>> when it tries to rewrite. I can't rename the subdirectory and the users
>> are demanding that they be able to use just the word "overview" as a
>> hyperlink.
>>
>> Any suggestions? And I'm under a major time constraint :(
> 
> What does the error log say?  What does the RewriteLog say?
> 
> The easist way to do this would be to put the RewriteRule in the main
> server config rather than in .htaccess.  Then you can simply use
> RewriteRule ^/guide/overview$ 
> /guide/index.cfm?item=Chapter&Chapter_ID=C342 [L]

Otherwise, as you're using a .htaccess file, you probably need to add a
"RewriteBase /guide" statement. Otherwise you get into a sort of
chicken/egg scenario about the order of resolving URLs to bits of the
filesystem: see the bit at the top of the mod-rewrite docs for more info.

Andy



---------------------------------------------------------------------
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] .htaccess error URGENT

Posted by Joshua Slive <jo...@slive.ca>.
On 6/29/06, Dwayne Tharpe <dt...@unc.edu> wrote:
> Hi all,
>
> I'm new to this and have never used mod-rewrite before or used regular
> expressions.
>
> We have a need to mod_rewrite a link.  Below is what I'm using in a
> .htaccess file:
>
> RewriteEngine on
> Options FollowSymLinks
> RewriteRule ^overview$ /guide/index.cfm?item=Chapter&Chapter_ID=C342 [L]
>
> The problem is that "overview" is the name of a subdirectory under
> guide, so I get an error (403 I think)
> when it tries to rewrite. I can't rename the subdirectory and the users
> are demanding that they be able to use just the word "overview" as a
> hyperlink.
>
> Any suggestions? And I'm under a major time constraint :(

What does the error log say?  What does the RewriteLog say?

The easist way to do this would be to put the RewriteRule in the main
server config rather than in .htaccess.  Then you can simply use
RewriteRule ^/guide/overview$ /guide/index.cfm?item=Chapter&Chapter_ID=C342 [L]

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