Click here to get back home

htaccess rules.

 HomeNewsGroups | Search | About
 alt.www.webmaster    Post an article   get this group's latest topics as an RSS feed add this group's latest topics to your My MSN content add this group's latest topics to your My Yahoo content
Subject Author Date
htaccess rules. frizzle 12-08-2006
Get Chitika Premium
Posted by frizzle on December 8, 2006, 11:09 am
Please log in for more thread options


Hi there,

I have a site, and i need some help with the htaccess. I'm not being
lazy here, but my own tryings ended up with nothing or with error
500's.

What i need are the following things:
- Requests for "/admin" and "/Admin" should be redirected to "404.html"
if they're not from my IP address.

- if it's my IP, redir "domain.com/Admin", "domain.com/admin" and
"www.domain.com/admin" to "www.domain.com/Admin"
(note the capitals and the www)

- "domain.com/en" to "domain.com/index_en.html" and "www.domain.com/en"
to "www.domain.com/en"

I hope i'm not asking too much, i couldn't figure this out myself ...

Thanks!


Posted by John Bokma on December 8, 2006, 12:45 pm
Please log in for more thread options



> Hi there,
>
> I have a site, and i need some help with the htaccess. I'm not being
> lazy here, but my own tryings ended up with nothing or with error
> 500's.
>
> What i need are the following things:
> - Requests for "/admin" and "/Admin" should be redirected to "404.html"
> if they're not from my IP address.
>
> - if it's my IP, redir "domain.com/Admin", "domain.com/admin" and
> "www.domain.com/admin" to "www.domain.com/Admin"
> (note the capitals and the www)
>
> - "domain.com/en" to "domain.com/index_en.html" and "www.domain.com/en"
> to "www.domain.com/en"
>
> I hope i'm not asking too much, i couldn't figure this out myself ...

Show us what you got so far.

Also, check your error log (you didn't) because there is where the
description of the error is stored, and hence you don't need to guess what
you did wrong.

--
John Need help with SEO? Get started with a SEO report of your site:

--> http://johnbokma.com/websitedesign/seo-expert-help.html

Posted by frizzle on December 8, 2006, 2:49 pm
Please log in for more thread options


I have no access to an error log ...

What i have is this:

RewriteCond % !^my.ip.add.ress$
RewriteCond % ^/Admin(/.*)$
RewriteRule (.*) /include/error_404/$1 [L]

But even this doesn't work ...
I thought adding [NC} would make it case insensitive, but it didn't ...

Thanks for helping.

John Bokma schreef:

>
> > Hi there,
> >
> > I have a site, and i need some help with the htaccess. I'm not being
> > lazy here, but my own tryings ended up with nothing or with error
> > 500's.
> >
> > What i need are the following things:
> > - Requests for "/admin" and "/Admin" should be redirected to "404.html"
> > if they're not from my IP address.
> >
> > - if it's my IP, redir "domain.com/Admin", "domain.com/admin" and
> > "www.domain.com/admin" to "www.domain.com/Admin"
> > (note the capitals and the www)
> >
> > - "domain.com/en" to "domain.com/index_en.html" and "www.domain.com/en"
> > to "www.domain.com/en"
> >
> > I hope i'm not asking too much, i couldn't figure this out myself ...
>
> Show us what you got so far.
>
> Also, check your error log (you didn't) because there is where the
> description of the error is stored, and hence you don't need to guess what
> you did wrong.
>
> --
> John Need help with SEO? Get started with a SEO report of your site:
>
> --> http://johnbokma.com/websitedesign/seo-expert-help.html


Posted by John Bokma on December 8, 2006, 5:27 pm
Please log in for more thread options



> I have no access to an error log ...

Don't top post, see:
http://johnbokma.com/mexit/2006/04/11/how-to-reply.html

for a recipe on how to reply on Usenet.

As for no access to error log, that's crazy. Ask your incompetent hosting
provider to fix that asap. It should be living next to your access_log.

> What i have is this:

RewriteEngine On

> RewriteCond % !^my.ip.add.ress$
> RewriteCond % ^/Admin(/.*)$
> RewriteRule (.*) /include/error_404/$1 [L]
>
> But even this doesn't work ...
> I thought adding [NC} would make it case insensitive, but it didn't

You're sure you can use mod_rewrite? If you put just

RewriteEngine On

in your .htaccess do you get still 500? If you, time to look for a new
hosting provider I would say :-)

--
John Need help with SEO? Get started with a SEO report of your site:

--> http://johnbokma.com/websitedesign/seo-expert-help.html

Posted by frizzle on December 8, 2006, 5:56 pm
Please log in for more thread options



John Bokma schreef:

>
> > I have no access to an error log ...
>
> Don't top post, see:
> http://johnbokma.com/mexit/2006/04/11/how-to-reply.html
>
> for a recipe on how to reply on Usenet.
>
> As for no access to error log, that's crazy. Ask your incompetent hosting
> provider to fix that asap. It should be living next to your access_log.
>
> > What i have is this:
>
> RewriteEngine On
>
> > RewriteCond % !^my.ip.add.ress$
> > RewriteCond % ^/Admin(/.*)$
> > RewriteRule (.*) /include/error_404/$1 [L]
> >
> > But even this doesn't work ...
> > I thought adding [NC} would make it case insensitive, but it didn't
>
> You're sure you can use mod_rewrite? If you put just
>
> RewriteEngine On
>
> in your .htaccess do you get still 500? If you, time to look for a new
> hosting provider I would say :-)
>
> --
> John Need help with SEO? Get started with a SEO report of your site:
>
> --> http://johnbokma.com/websitedesign/seo-expert-help.html

I'm sure u can use mod_rewrite.

My adminsitration is ssh-based, and i don't know how to deal with that.
The previous webmaster of the site did, but he's gone ...


Similar ThreadsPosted
.htaccess rules help November 5, 2007, 4:40 pm
A unique htaccess config for an htaccess guru! April 23, 2006, 5:37 pm
is there a FAQ available where i can see the group's rules November 17, 2006, 7:45 am
Google and Rewrite Rules November 21, 2005, 12:05 am
I don't accept that life needs no rules. None. August 17, 2005, 9:29 pm
How am I going to win against that guy, who believes there are no need for rules. Not a single one. August 17, 2005, 9:40 pm
Follow Design Rules? September 12, 2006, 12:24 pm
Re: Rules for Mornington Crescent July 11, 2008, 2:12 am
Exchange links rules December 6, 2007, 7:05 am
Re: Rules for Mornington Crescent July 11, 2008, 7:28 am

Our other projects:

Art Dolls, Fairies and Mermaids - Sunnyfaces.net

Roy's Linux, Programming and Search Engines messages

1-Script XML SitemapXML Sitemap