0

I have to following situation: I had an old blog that was made using Joomla (this blog was indexed well enough by search engines). For some problems I delete it and I have create it again using WordPress.

Now I have many visit (from Google) that leading to specific pages of the old site (pages that don't exist in the new version).

For example I have visit to URL as: /scorejava/index.php/corso-spring-mvc/1-test that don't exist on my new site.

I would know if using the .htaccess file (or other sistem) I can redirect the HTTP request directed to some subfolder (that don't exist in the new version) to the homepage of my new site.

For example I have the request towards the void URL: /scorejava/index.php/corso-spring-mvc/1-test.

And I would create a regular expression that say something like: all the request toward the subfolder corso-spring-mvc (and all it's content file and subfolder) have to be redirected to www.scorejava.com.

Is it possible?

1 Answer 1

1

You need something like this:

RewriteEngine On
RewriteRule ^.*/corso-spring-mvc/ [R=301,L]

The regular expression can be pretty much anything. Whatever matches will be redirected to the root of your site, represented by / and the browser will get a 301 permanent redirect.

Now, I suspect you should try a more generic rule, otherwise you'll have a lot of them to write. If the old blog was under /scorejava/* for example, then you only need a rule like:

RewriteRule ^/score_java/ [R=301,L]
2
  • mmm the base URL (that now is in use) is scorejava.com. Simply I would map some specific subfolder (as /corso-spring-mvc) that have to be redirected toward the base URL. I would toward all the request to all the files in these specific subfolder (they arent mutch...only 3-4 subfolder) but the important thing is that the request to the resources in these subfolder are redirect Commented Apr 9, 2013 at 14:35
  • Normally you redirect the page and resources are requested for the new page, in this case your home page. Are you saying there are direct links to resources too?
    – Itai
    Commented Apr 9, 2013 at 14:53

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.