homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
Forum Library, Charter, Moderators: Ocean10000 & incrediBILL & phranque

Apache Web Server Forum

Rewrite question.assistance please guys
folder redirection

5+ Year Member

Msg#: 3414121 posted 10:47 am on Aug 5, 2007 (gmt 0)

ok guys.

I have a custom php/mysql based site and for SEO friendliness it has a section that contains php generated SE friendly html links/files.(I have sitemaps also etc)

Here's the issue:

I have a directory:


and within that there is only an index.php that when called runs the seo engine bit and generates a nice SE index of the entire site with all links etc (it is dynamic content)

I want to call that page with mysite/seolove/index.html

so I can add it to the xml sitemap as a site summary in effect and as the top weighted link in the map. I will also add the sub links seperately (not sure if this is bad practice?)

What's the best way to accomplish this please?

At present when I call www.mysite/selove/index.php, it is just putting:


in the address bar.

So basically I want to force it to display

www.mysite/selove/index.html which is in turn a

redirection of


Hope that makes sense!
thanks for your time



5+ Year Member

Msg#: 3414121 posted 7:20 pm on Aug 5, 2007 (gmt 0)

RewriteEngine on
RewriteRule selove/index.php [%{HTTP_HOST}...] [R,L]
RewriteRule selove/index.html /selove/index.php [L]




5+ Year Member

Msg#: 3414121 posted 11:13 am on Aug 6, 2007 (gmt 0)

thanks milan!

Will try this and post back :)


5+ Year Member

Msg#: 3414121 posted 11:23 pm on Aug 6, 2007 (gmt 0)


Well, unfortunately it hsa only part worked (where is JD Morgan when you need him? :) )

Basically, the URL /mysite/seolove/

is being re written as /mysite/seolove/index.php

However the index.php is not being rewritten to .html!
Is it possible to rewrite a rewrite? I guess not!

So, if I type in /mysite/seolove/index.html

I get a 404 error

It feels like this puzzle is 'nearly' solved but the final piece is missing?!

Can anyone here please fit the final piece to my re write jigsaw?!

I need /mysite/seolove/

that actually points to


rewriting to a .html extension instead of a .php

This is my current .htaccess for this directory

Options FollowSymLinks
php_value session.use_trans_sid 0
RewriteEngine on
Lots more working code****************//the new code//

RewriteRule list/index.php [%{HTTP_HOST}...] [R,L]
RewriteRule list/index.html /list/index.php [L]



5+ Year Member

Msg#: 3414121 posted 2:58 am on Aug 7, 2007 (gmt 0)

I thought of trying to switch the rules but that will create an infinite loop!


Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved