Htaccess从/ example重定向到/folder/example.php

I would like to create some temporary redirects for a few pages on a website I'm working.

I'd like to 302 redirect like this:

From: site.com/example1/ To: site.com/folder/example1.php
From: site.com/example2/ To: site.com/folder/example2.php

The site is based on wordpress, and I recently add a mini-site into /folder/ that has static php files. I know it's an odd redirection, but for a while I'd like serve the visitors with some an alternative content.

My problem is when I'm using:

Redirect 302 /about/ http://site.com/folder/about.php

When I access the site.com/about/ link I get redirected to site.com/folder/about.php/

The trailing slash causes for stylesheets not to be loaded correctly.

I'd appreciate any suggestion

I am not entirely sure what you're trying to do here so here is the syntax for a 302 Redirect. This is assuming file page will have the redirect at the top.

header("Location: http://www.example.com/about.php");
exit;

http://php.net/manual/en/function.header.php

Hmm... are you changing the domain at all? Try this: Redirect 302 /about/ /folder/about.php It worked on the example I worked up just a moment ago. Hopefully it will work for you.

http://corz.org/serv/tricks/htaccess2.php

on this website, you`ll find useful tips to create URL Redirections using the .htaccess file