httpd-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Matthew Sacks" <ntw...@gmail.com>
Subject Re: [users@httpd] Re: help with rewrites - changing the base path
Date Wed, 31 Dec 2008 06:48:36 GMT
hi list,
new problem:

when i try to add a rewrite just for the base url, it doesn't work and
appends the destination url twice and ends up as a 404:

how can i accommodate the wild-card and the base path (RewriteRule ^/$
http://www.foobar.com)?


# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /techblog


RewriteRule ^/$ http://www.foobar.com
RewriteRule /about http://www.foobar.com/about [R=301]
RewriteRule /(.*)$  http://www.foobar.com/$1 [R=301]

On Mon, Dec 29, 2008 at 3:03 PM, Eric Covener <covener@gmail.com> wrote:
> On Mon, Dec 29, 2008 at 5:53 PM, André Warnier <aw@ice-sa.com> wrote:
>> Hi.
>>
>> Am I interpreting this correctly, that the .htaccess file you are talking
>> about, is the one that is in the original /techblog location ?
>>
>> If so, and without taking my word for it, isn't it so for a RewriteRule that
>> is in a .htaccess file in such a location "/techblog", that the original URL
>> you are comparing against already has the "/techblog" prefix removed ?
>>  (because you are "already there" so to speak)
>>
>> Maybe you want to try this instead :
>>
>> RewriteRule /(.*)$  http://www.foo.com/$1 [R=301]
>
> in techblog/.htaccess, "/techblog/" is removed, including the trailing slash.
>
> --
> Eric Covener
> covener@gmail.com
>
> ---------------------------------------------------------------------
> 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
>
>

---------------------------------------------------------------------
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


Mime
View raw message