matt
matt

Reputation: 1025

Unique url htaccess or other redirect needed

I need to somehow make one unique url redirect.

For instance: http://www.mydomain.com/shop needs to redirect back to http://www.mydomain.com

BUT

http://www.mydomain.com/shop/tshirts etc still needs to function, I cant manage to get this to work. No matter what I attempt anything containing /shop/xxx redirects which I dont want it to.

Thanks in advance!

Upvotes: 0

Views: 248

Answers (3)

Abdul Haseeb
Abdul Haseeb

Reputation: 548

Your redirection seems simple enough, so you can use redirect directive for this.

In your .htaccess file, add this redirect.

Redirect 301 /shop  http://www.mydomain.com/


    301: permanent
    302: temp
    303: seeother
    410: gone

mod_alias needs to be enabled in config.

Upvotes: 0

Abhishek Saha
Abhishek Saha

Reputation: 2564

Try this. Write this in .htaccess file.

RewriteEngine on
RewriteCond %{REQUEST_URI} /shop
Rewriterule ^$ http://mydomain.com/test/ [L,R=301]

Upvotes: 1

ro0ter
ro0ter

Reputation: 439

You need to enable MOD_REWRITE.

Place a .htaccess file in the root folder of your server and have it contain:

RewriteEngine On
RewriteRule ^(.*)shop/$ http://mydomain.com/ [R,L]

Hope it works for you!

Upvotes: 1

Related Questions