Forum Moderators: phranque

Message Too Old, No Replies

Redirect between full URL

make the redirect command using full URLs

         

CCastrillo

1:34 pm on Dec 2, 2011 (gmt 0)

10+ Year Member



Hi yall!

We use Magento OS commerce platform. And we have multiple websites ponting to the different stores set up on that Magento installation.

We want to implement the .htaccess with some redirections we need.

Our problem is that we have 2 domains that share the categories name, so we need to make the redirect command using full URLs... To explain myself I give you an example that wht it should be:

Redirect 301 [domain.com...] [doamin.com...]


I know that example is wrong but I need exactly that... To be able to use full URL on both staments.


Please help, I´m completly lost here.

Thanx

g1smd

1:40 pm on Dec 2, 2011 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Use example.com in this forum. It stops the auto-linking process.

Use a RewriteRule configured to deliver a redirect not the Redirect directive itself.

CCastrillo

4:13 pm on Dec 2, 2011 (gmt 0)

10+ Year Member



Thanx g1smd, I´m new here so dnt know the tricks!

Yeah, RewriteRule... I thought of that... but maybe I cant get the staments right... Could you please please give me an example?

Really appreciate the previous quick reply! Thanx buddy!

g1smd

4:16 pm on Dec 2, 2011 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



There's 50 000 threads here with redirect examples.

Read a few. Try some code. Experiment.

Post your code and what problems you're having when you've tried several things and it's still not working.

lucy24

10:33 pm on Dec 2, 2011 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Use example.com in this forum. It stops the auto-linking process.

... but is not phenomenally useful when you need to post two different domain names to make your point ;)

One option is to do something you normally shouldn't do: omit the full protocol-and-domain from the target. So if the request pertains to domain1, the target will reappend domain1. If it's for domain2, it stays in domain2.

Another option is to move down one directory and let each domain have its own htaccess. After all, that's the point of htaccess: it can go in any directory anywhere.

For example (this works well for me, but will not work for everyone): I've got two domains sharing a userspace. Physically, that means two directories inside one directory. They share a top-level htaccess that lists only the core-level things that are exactly the same for both, like Deny from... and the "Allow all" filename exceptions. (That is, they've each got their own robots.txt, missing.html and so on, but each has the same name and they each follow the same rules.) At the next level, where the domains are in separate directories, each one has its own htaccess for mod_rewrite. There is some overlap between these two parallel htaccess files, but it seemed like a very very bad idea to divide one module among multiple htaccess files.

g1smd

10:44 pm on Dec 2, 2011 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



If you take a look at RFC 2606 you'll see the .net and .org are also reserved, and work exactly the same as example.com in this forum. :)