Apache :: How To Redirect To Different File In HTAccess

Jan 27, 2013

So, I would like my htaccess file to check if a file exists and if it doesn't then redirect to another file. How would I go about doing this?

View 5 Replies


ADVERTISEMENT

Htaccess Redirect (from A File With Spaces)

Nov 26, 2006

I'm trying to redirect from a filename that contains spaces using .htaccess

for example, I want to redirect /test 2.html to http://example.com

I've tried:

ReDirect /test 2.html http://example.com
ReDirect /test 2.html http://example.com
ReDirect /"test 2".html http://example.com
ReDirect /'test 2'.html http://example.com
ReDirect /test%202.html http://example.com
ReDirect /"test 2.html" http://example.com
ReDirect /'test 2.html' http://example.com

And a few others. I can't seem to get the syntax right, and always end up getting an internal server error message. Anyone have any ideas?

View 6 Replies View Related

Apache :: Redirect URL Using HTAccess

Jul 17, 2013

I have a website. I would like to redirect all user/author url to one author/admin...e.g All aurthor links to redirect to one author link

author 1. mysite (dot) com/author/x
author 2. mysite (dot) com/author/y
author 3. mysite (dot) com/author/z
they are about 300

I would like all of them to redirect to author 2. mysite (dot) com/author/admin.

View 3 Replies View Related

Apache :: Mass 301 Redirect HTAccess

May 11, 2013

I've not seen an answer for this mass 301 redirect issue specifically.. How to do this...

category/brand URLs:

redirect: /ID-some-brand (e.g. /43-religion-clothing or /26-ichiban) to: /some-brand (e.g. /religion-clothing or /ichiban)

Product URLs:

redirect: /some-category/ID-some-product-name.html (e.g. /mens-sweat-shirts/1543-ichiban-fairly-offensive-sweat-in-grey.html)

to: /some-product-name (e.g. /ichiban-fairly-offensive-sweat-in-grey)

We have 1,090 products and 60+ categories so some form of .htaccess trick would be amazing to know. What I could put in the .htaccess to accomplish this.

View 1 Replies View Related

Apache :: HTAccess Redirect Loop

Jan 25, 2014

Well, I was trying to use the following in htaccess, but I get the message of redirect loop.

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?page=$1 [L,QSA]

What I want to do is this: The URL is like somedomain.sub.com/somepage/s1/s2The index.php is accessible from somedomain.sub.com/somepage/I want to send s1/s2 as $_GET['page']

Also, I don't want the URL in the address bar to change, only the url sent to the server should change. This worked well in my localhost, but on webserver (0fees.net), it doesn't work ...

View 1 Replies View Related

Apache :: HTAccess Needs For Rule To Redirect

Feb 21, 2013

I have page like that : [URL] ....

I want to permanent redirect it to : [URL] ....

Also needs to redirect all another page have words ( rates ) to index.

View 9 Replies View Related

Apache :: Redirect In HTAccess Does Not Work

Sep 18, 2014

One site just linked to my website with incorrect URL as URL.. want to correct this by redirecting the URL to URL.... Therefore, I add the following line in my .htaccess, as follows: Redirect 301 /aor/%e2%80%9d URL...

However, this does not work. When I input URL... in Firefox or IE, the browser still said the page not found(404) error.

View 1 Replies View Related

Apache :: Create HTAccess Redirect?

Feb 3, 2014

Google keeps indexing some of my articles in this form:

mywebsite.com/item/my-article

However I'm mainly using:

mywebsite.com/item/articles/my-article

So in a way I have duplicated content and also the first link does not show the modules I want. I want to create a .htaccess redirect than whenever someone joins on the first link to be automatically redirected to the second link.

View 5 Replies View Related

Apache :: HTAccess - Redirect Only One Kind Of URLs

Jan 28, 2014

This redirect redirects all subpages of a domain to another domain while not redirecting to index.php but to same page, only at another domain:

RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} !^cz.hq-scenes.com$ [NC]
RewriteRule ^(.*)$ http://cz.hq-scenes.com/$1 [R=301,L]

I want to achieve that only pages like /viewtopic.php...............

will be redirected (............. means any other characters)

How to redirect all viewtopic.php pages only? How to modify it? 

View 2 Replies View Related

Apache :: Redirect Matching First Characters Of URL Using HTAccess

Jun 12, 2013

I want to redirect all the URLs starting from specific characters.

For instance:

www.example.com/abc-apple
www.example.com/abc-bat.html
www.example.com/abc-cat.php

All of the URLs above starts with "abc-" I want a redirect code to redirect all URLs starting from "abc-" to a single URL i.e. www.example.com/all 

View 1 Replies View Related

Apache :: HTAccess Redirect Root To Folder

Nov 28, 2006

I searched URL....but I still could not get this to work.I need a redirect to a certain folder when people visit the root directory of my site.

View 7 Replies View Related

Apache :: Cannot Find Right Redirect Code For HTAccess

Feb 26, 2013

For an unknown reason Google is generating url extentions on rich snippet pages. the most common one that I get it domain.com/?SD I would like to get rid of ?SD and redirect to domain.com or / is enough Now, I am unable to redirect using htaccess %{QUERY_STRING} , and a few other syntaxes did not work.

View 2 Replies View Related

Apache :: What Is HTAccess File

Jan 31, 2013

what is .htaccess file? use of this file?

View 6 Replies View Related

Apache :: Removing PHP For One File Only In HTAccess

Jun 11, 2014

I'd like to change /comp.php to /comp but I have only found articles on how to remove .php completely and I don't want to do that, only want to do it for this one file.

View 5 Replies View Related

Apache :: Write HTAccess File For A 301

Apr 15, 2013

I have learned some bits of regular expressions for simple scripting, writing a .htaccess file is, uh, syntaxically daunting.

THE CASE :

The URLs of my site used to be of the form [URL] ... . They are now of the form [URL]......

I am trying to perma-redirect (301) the old format (affiche_fiche.php) to the new format (fiche.php) using a .htaccess.

So far all I have achieved is a hatred of punctuation signs. What's the correct syntax to have a .htaccess that does the redirect ?

THE CONTEXT : The format change took place more than six months ago, but the Google Webmaster Tools still spits 450 problems a day with 404s on URLs using the old format. I had assumed that these would just fade away, but they don't. So I guess that 301'ing them is cleaner. Or would be, if I understood the syntax.

View 7 Replies View Related

Apache :: HTAccess File Is Not Working?

Feb 20, 2014

I want to upload the custom 404 error page and .htaccess file to my website but .htaccess is not working on my web server. I have use the correct file name and try it many time but no result I have found. My web server is Microsoft IIS 7.5

View 2 Replies View Related

Apache :: 301 Redirect Without Creating File

Jul 16, 2013

We are redoing our website and we have removed / renamed a few old pages. I was wondering if I can do 301 redirect for removed / renamed pages without having to actually create them? To explain with an example:

On old website : www.domain.com/mypage.php
On new website: www.domain.com/mynewpage.php

I created a 301 redirect in .htaccess redirecting mypage.php to www.domain.com/mynewpage.php without physically creating "mypage.php" file. When I access "www.domain.com/mypage.php", I get a 404 page not found error. When I create a blank "mypage.php", the redirection works fine.

Is it possible to do a 301-redirect without having to create old files ?

View 4 Replies View Related

Apache :: Can Have HTAccess File Which Create Links

Mar 16, 2013

In my personal website at URL.... I have the top like 'index.php?pg=profile', 'index.php?pg=home' or 'index.php' (without any querystring), 'index.php?pg=diary' etc. I am looking to see if I can have .htaccess file which can make me create links like

index.php/
index.php
index.php/home
index.php/profile
index.php/diary

write an .htaccess for the same?

View 1 Replies View Related

Apache :: How To Deny Access To Specific File Using HTAccess

Jun 21, 2014

I would like to deny access to .log

View 1 Replies View Related

Apache :: How To Select Specific File With Path Using HTAccess

Jun 14, 2014

I want to select a specific file by its path using .htaccess to allow access to it.

View 1 Replies View Related

Apache :: HTAccess File Included In Project - Stuck With 403 Error

Oct 8, 2012

I was trying to set up archive-my-tweets [URL] .... and I seem to have gotten stuck with a 403 error. When I remove the .htaccess file the 403 goes away but so do the rewrite rules so that's a problem.

You'll see the contained .htaccess file that's included in the project.

Basically for now I'm just trying to run this on my mac. I have set up the files in a subdirectory of my personal web server. The personal web server is working fine--but when I go to the /tweets directory I get the 403.

View 8 Replies View Related

Apache :: Will Editing HTAccess File In Cpanel Effect All Wordpress Domains And Subdomains

Mar 26, 2014

I added the following to my cpanel .htaccess file on my hosting account:

<FilesMatch ".pdf$">header set x-robots-tag: noindex
</FilesMatch>

This was to stop Google from crawling and indexing my PDFs, will this work accross all my addon domains and subdomains (which are wordpress) on my hosting account or do I need to take extra measure?

View 4 Replies View Related

Redirect Old Url To New Url Using .htaccess

Jun 6, 2009

Apache redirect. I would like to point all the old site URLs to my site homepage e.g.

[url]should point to [url]

or better,

[url]should point to [url]

tell me the redirect code i need to add to my .htaccess file to make this work?

View 3 Replies View Related

.htaccess Redirect

Apr 28, 2008

I know how to do a redirect to a new URL using a .htaccess file if I am pointing to a different server, however both domain.com and domain.com.cn are pointing to the same server, I just am wondering what I would add into my .htaccess file to get it to redirect from domain.com.cn to domain.com?

View 4 Replies View Related

301 Redirect In .htaccess

Feb 27, 2007

I am trying to redirect from:
[url]

over too:
[url]

Now the software i'm using on the /forums/ is different, so i need ALL inbound links to any area of phpBB2 to redirect to /forums/ and be stripped of the "index.php=topic111.22."

All the redirects I have tried seem to leave the rest of the URL on then give a page not found.

View 3 Replies View Related

301 Redirect With .htaccess

Jul 12, 2007

I am attempting to do a directory 301 redirect with a .htacccess. I have followed the instructions but it is not working. I have heard that I will have to wait for Apache to restart on the server before it will work. Is this true?

View 3 Replies View Related

.htaccess - Redirect To A Subdomain

Jul 10, 2009

I wasn't able to just export and import so I had to manually recreate content. I used the same permalink structure in hopes that I "might" be able to do a re-direct. Just now sure if A)It is possible or B)How to do it.

Example:
OLD LINK:
[url]

NEW LINK:
[url]

Am I able to redirect all traffic that comes in and replace the "www.cgcookie.com/articles" with "cg.cgcookie.com"?

View 4 Replies View Related

Redirect All Users Except Me With Htaccess

Mar 13, 2008

I'm going to be doing some upgrades on my site and I want to redirect all users to a different page while I do the upgrades but I need to allow my self too have access.

I have done this before with a htaccess rule, but I can't remember what it was and can't seem to find it anywhere.

View 2 Replies View Related

Redirect From One Folder To Another Via .htaccess

Jan 13, 2007

We had a subdomain that was [url]and we have now decided we would like to use [url]

I have setup the gallery on the new server as [url]

I would like to be able to if someone had a link [url]for it to redirect them too [url]

View 3 Replies View Related

.htaccess Redirect *.pdf To /newdir/*pdf

Jan 24, 2007

I want to redirect all requests for .pdf files from one dir to another.

OLD DIR: www.domain.com/en/product/pdf/
NEW DIR: www.domain.com/global_pdf/

...so when someone requests:
www.domain.com/en/product/pdf/john.pdf

it loads:
www.domain.com/global_pdf/john.pdf

I think I need to use RedirectMatch or RedirectRule to check for *.pdf but I have no idea how to write the expression matching thing.

View 2 Replies View Related

.htaccess Redirect Configuration

May 19, 2007

I have 2 domains, [url]and [url]. Notice that the old one has www, and the new one doesn't.

I want to redirect ALL html pages from [url]to the page [url].

I have Googled a bit and found this code to use in the .htaccess file of the old domain:

RedirectMatch (.*).html$ [url]

However it does not work. It only redirects from [url]; it does not redirect from [url] or any internal pages.

View 3 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved