PDA

View Full Version : RewriteRule Help - Remove "index.php" from address



jspirko
03-23-2008, 08:28 AM
I have used the recommended domain root redirect method by BlueHost (see below). When I use this method my Wordpress permalinks are in the format:

Pages: http://www.koyama.us/index.php/techniques/
Posts: http://www.koyama.us/index.php/2008/03/promotions/

I would like to remove the "index.php" from the links so they look like this:

Pages: http://www.koyama.us/techniques/
Posts: http://www.koyama.us/2008/03/promotions/


My directory structure:
/public_html
|--/www (Wordpress installed here)
|--/test
|--/old

I have the following .htaccess file in /public_html/:

# Bluehost.com
# .htaccess main domain to subfolder redirect
# Copy and paste the following code into the .htaccess file
# in the public_html folder of your hosting account
# make the changes to the file according to the instructions.


# Do not change this line.

RewriteEngine on


# Change yourdomain.com to be your main domain.

RewriteCond %{HTTP_HOST} ^(www.)?koyama.us$


# Change 'subfolder' to be the folder you will use for your main domain.

RewriteCond %{REQUEST_URI} !^/www/

# Don't change this line.

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

# Change 'subfolder' to be the folder you will use for your main domain.

RewriteRule ^(.*)$ /www/$1

# Change yourdomain.com to be your main domain again.
# Change 'subfolder' to be the folder you will use for your main domain
# followed by / then the main file for your site, index.php, index.html, etc.

RewriteCond %{HTTP_HOST} ^(www.)?koyama.us$
RewriteRule ^(/)?$ www/index.php [L]


Obviously I am not well versed in Apache rewrites. Does anybody know how to accomplish this?

Thanks!

TheWebHostingHero
03-29-2008, 09:48 AM
You'd have to install Wordpress into /public_html, not into /public_html/www

At least it would make things a lot easier.