homepage Welcome to WebmasterWorld Guest from 54.226.168.96
register, free tools, login, search, subscribe, help, library, announcements, recent posts, open posts,
Pubcon Website
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
and1c




msg:3414123
 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:

mysite/seolove/

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:

www.mysite/selove/

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

www.mysite/selove/index.php

Hope that makes sense!
thanks for your time

 

milanmk




msg:3414298
 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]

UNTESTED!

Milan

and1c




msg:3414719
 11:13 am on Aug 6, 2007 (gmt 0)

thanks milan!

Will try this and post back :)
cheers

and1c




msg:3415374
 11:23 pm on Aug 6, 2007 (gmt 0)

ok.

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

/mysite/seolove/index.php

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]

THANKS

milanmk




msg:3415478
 2:58 am on Aug 7, 2007 (gmt 0)

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

Milan

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.
Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About
© Webmaster World 1996-2014 all rights reserved