0

I had a site, say example.com/drupal running on xampp

I have since changed the DocumentRoot in httpd.conf to /drupal/, so that I could access my site using example.com

But Google has already crawled my site and shows results of the form

example.com/drupal/something

which of course go to 404 pages.

How do I use RewriteRules to redirect

example.com/drupal/something

to

example.com/something ?

2 Answers 2

1

I'd simply use the standard Apache RedirectPermanent directive instead of bothering with attempting to use the relatively expensive Rewrite engine.

Check out http://httpd.apache.org/docs/2.2/mod/mod_alias.html#redirectpermanent

2
1
RewriteRule ^/drupal$ / RewriteRule ^/drupal/(.*) /$1 

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.