Modifying .htaccess

wordpress

#1

I already posted this with a different subject line, but I don’t think it was a good one (didn’t get responses) so I’ll try again.

A WordPress plugin I use only works if the index page’s filename is part of the URL.

So, when someone enters my blog’s URL as:
http://www.jbryant.org/library

I need it to resolve to:
http://www.jbryant.org/library/index.php

DreamHost support tells me that I need to do this through an .htaccess modification, but beyond that they aren’t able to help.

I have modified .htaccess before and generally know how to edit it, but I need someone to tell me explicitly what I need to add. This is not my area of expertise. I’ve searched the Web for the solution, but to be honest I get lost when I read through all the possibilties. If someone can tell me just what I need to add or change, though, I can do it.

Can you help?


#2

Try this:
redirect perminate http://www.jbryant.org/library http://www.jbryant.org/library/index.php

My website


#3

Sorry typo should be permanent
You can also use the code which I beleive is 301.

My website


#4

Yeah 301 redirects are awesome… especially if you’re concerned with moving pages or sites while retaining search engine ranks.

Maximum Cash Discount on any plan with MAXCASH


#5

Silkrooster:

Thanks for the reply. I added the following line to the .htaccess file that is at the top level of my blog’s directory structure:
redirect permanent http://www.jbryant.org/library http://www.jbryant.org/library/index.php

I added that line as the second line, right below the line that reads “# BEGIN WordPress”

It didn’t have any effect.

I’m not sue what you mean by “using the code”

Further help would be greatly appreciated.


#6

RedirectMatch ^/library/$ http://www.jbryant.org/library/index.php

As for the status codes, see the documentation

If the url-path /library/ exists as a directory on the file system, “http://domain/library” becomes “http://domain/library/

And naturally if you read the entry for “Redirect” you’ll notice the url-path in the directive is matched against the beginning of the url - thus you have to use RedirectMatch to indicate you are trying to match a url that begins and ends as /library/

:cool: openvein.org -//- One-time [color=#6600CC]$50.00 discount[/color] on [color=#0000CC]DreamHost[/color] plans: Use ATROPOS7


#7

Atropos7:

Bingo! You got it. It now works, and what’s more, I understand how it works.

Thanks you!

Thanks also to silkrooster and sXi for all your help.

jb