Forum Moderators: phranque

Message Too Old, No Replies

redirect from subdirectory

         

strophi

8:19 pm on Aug 31, 2008 (gmt 0)

10+ Year Member



Hi Forum,

here's my first noobie thread:

I've moved a project from a subdirectory into the root directory. I'm on a new machine.

I want to redirect permanently all http://www.example.com/projekte/projektc/index.php?id=xyz

to http://www.example.com/index.php?id=xyz to avoid duplicate content.

Please dont laugh, this is my try:

RewriteEngine On
RewriteRule ^projekte/projektc/(.*)$ http://localhost/$1 [R=301,L]

doesn't work, even worse it exposes some php-code from my cms...

please give me some advice.

thanks in advance

strophi

[edited by: tedster at 4:18 am (utc) on Sep. 1, 2008]
[edit reason] use example.com in code [/edit]

strophi

6:48 pm on Sep 1, 2008 (gmt 0)

10+ Year Member



Hi,

I solved it by...

adding

Redirect permanent /projekte/projektc/ http://www.example.com/

to .htaccess in www.example.com document root.

And it works...

sometimes it helps to google the topic of a posted posting ;-)

Yours,

strophi