.htaccess rewrite issue - probably dead simple

Hello all

I am trying to move multiple old urls to a single new one on the same domain, but I have searched and tried different rules and they do not come out as wanted.

Let’s say I have 3 old urls:

http://mydomain.com/index.php/something
http://mydomain.com/index.php/something/sub-something-1
http://mydomain.com/index.php/something/sub-something-2

All 3 urls should now point to this new url:

http://mydomain.com/something

How is this done using .htaccess?

Thanks in advance
Thomas

Hi Thomas!

Oh, my, that’s a HUGE question. Before I get into that, though, I need a few questions answered:

  1. Are you on an Apache server? What version (1.x or 2.x)?
  2. Do you have Options +MultiViews (enabled)? Why? IMHO, it’s a horrible thing to do (embed the file to be served in the path, i.e., NOT as the file request at the end of the URI).
  3. What do you expect to serve using “something” as your URI?

Without index.php in the URI, it would be the smart thing to do to use a mod_alias redirect statement (which should loop on the first example).

If you are wanting to make your redirect to “something” AND can actually serve a file, you can sort that out easily using my mod_rewrite tutorial (http://dk.co.nz/seo) with the hint that you make the specific redirections first then the general redirections.

Back to your MultiViews “problem.” It looks like you’re trying to redirect TO a new format (which cannot be directly served) so I’ll ask you to look at the “Redirect to NEW format” in my tutorial. Yes, it’s covered in the examples (as are virtually all every day problems).

Regards,

DK

Thanks for answering DK

Here are the answers to your questions:

  1. Apache 2
  2. I am not really sure I understand this one.
  3. A “pretty” php page in Wordpress

Basically I have two old .php pages from a Joomla site. Both pages had a long url and were re-written with a plugin of some sort. The content is combined into one .php Wordpress page, again with a re-written url, this time using Wordpress native url functions.

Not sure if this makes sense?

Regards
Thomas

I got it all sorted :smile:
Tried out the re-direct function in the c-panel and that worked as it should.
But thanks again DK.

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.