.htaccess

.htaccess Subfolder Redirect

Hey Guys & Gals, I recently moved my WordPress website to a subfolder. I want to add a redirect in the .htaccess file so that the links to images I've uploaded originally to ~/wp-content/uploads/ will pass to ~/blog/wp-content/uploads. The .htaccess file must remain in the root folder for WordPress to read it properly. This is what I tr...

.htaccess redirect domain alias / parked domain

Hi... I have a .htaccess related question. For example, if I have two domain, a.com and b.com. All referring to one host (b.com is domain alias of a.com). I want visitor that visit a.com will be referred to url with www (http://www.a.com). As for the visitor of http://b.com will be referred to the www url (http://www.b.com). How can I...

PHP .htaccess issue, specific/dynamic keywords

Here goes my .htaccess file's content. Options +FollowSymLinks RewriteEngine On RewriteRule ^online-products$ products.php?type=online RewriteRule ^land-products$ products.php?type=land RewriteRule ^payment-methods$ payment-methods.php RewriteRule ^withdrawal-methods$ withdrawal-methods.php RewriteRule ^deposit-methods$ deposit-methods...

Drupal and wordpress on the same site

Hello I have a drupal installation in the root directly of my domain with clean urls enabled. I also have a sub directory with wordpress installed. /blog/ I also have a sub directory with php scripts in it /utilities/ When I type in "http://www.domain.com/blog/a-post/" I get a 404 error from Drupal telling me that the page does not...

HTACCESS Rewrite on directories

I have the following code in my Root htaccess file RewriteCond %{HTTP_HOST} ^paperviewmagazine.com RewriteRule (.*) http://www.paperviewmagazine.com/$1 [R=301,L] It works fine for the main site, but for my forums at /forums/ if someone misses off the www it will show the page and not redirect to the www.paperviewmagazine.com/forums/ i...

How Can I ReWrite flat link to a dynamic link and preserve the Query string?

Hello All, I am wanting to rewrite a url like: http://my.project/mydomain.com/ANY_NUMBER_OF_CATEGORIES/designer/4/designer-name/page.html to this: http://my.projects/mydomain.com/ANY_NUMBER_OF_CATEGORIES/page.html?designer=4 I would like to use mod-rewrite to accomplish this. Things to note: Any number of categories can be between ...

.htaccess - proxy AND browser caching???

In .htaccess, how do I specify a file type to be cached via browser and proxy? Cache-control for needs to be "private" for browser, "public" for proxy. However, I can't define Cache-Control to be private AND public for same file type. It seems like I have to choose between browser or proxy caching. Suggestions? ...

Htaccess rewrite rule .aspx to .php

Background: I have a website that has been built with ASP.NET 2.0 and is on Windows hosting. I now have to rewrite my site in PHP and move it into Linux hosting. I have a lot of incoming links to my site from around the web that point directly into the old .aspx-pages. The site itself is very simple, one dynamic page and five static ones...

How do I prevent access to domain subfolders when hosting two domains using the same webspace?

I have two domains that point to the same root folder of my webspace. My root directory is setup like so: /domain1 /domain2 /shared Where requests to... http://www.domain1.com/* should do an internal redirect to http://www.domain1.com/domain1/* http://www.domain2.com/* should do an internal redirect to http://www.domain2.com/domain...

Htaccess... first force www than ask for login

I have an .htaccess file that mainly does 2 things. Force www on the domain and ask for login credentials (with .htpasswd). If I now visit domain.com it will ask for a username and password. When I fill them in I get redirected to www.domain.com and then it asks me to log in again. Is there any way to get the www redirection done befor...

Redirect Match 301 .htaccess Issue

Ok, so we are using vBulletin..ya I know. Which is within our Kohana based system. The breakdown is as follows. This is how vBulletin marks its member URL's http://server.com/forum/member.php?21148-username I need to redirect them to this. http://server.com/member_profile/view/vb/21148 In my .htaccess I have this rule RedirectMatc...

Resolving Images after URL Changes - .htaccess

Hi, I have done few changes and unable to get my images resolved correctly. Old = http://www.domain.com/dir/images/*.jpg New = http://www.domain.com/old_dir/images/*.jpg I am using the following RewriteRule, RewriteRule ^dir/images/(.*)\.jpg$ old_dir/images/$1\.jpg [R=301] Doesn't work, any pointers on how to get to work the im...

Problems with mod_rewrite, help!

I have the php mail function on a page but every time I load that page, I wil get 8-12 mails instead of 1 mail. The problem is the htaccess I suppose. My .htaccess: Options +FollowSymLinks Options -MultiViews RewriteEngine On RewriteCond %{ENV:REDIRECT_STATUS} ^$ RewriteCond %{SCRIPT_FILENAME} !-f RewriteCond %{SCRIPT_FILENAME} !-d...

Mod Rewrite: I want to redirect all requests to index page unless the file exists (but not if the file is a php file)

I have a .htaccess file like this right now. It sends everyone to the index page unless you wanted a real file. This is sort of what I want, but I dont want anyone to be able to access a .php file. So this is what I have: RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-f [NC] RewriteRule ^(.*) /index.php [NC] But this is what I wan...

Apache mod_rewrite help, send folder to subdomain

I want to make my .htaccess file do this: From: http://www.domain.com/example -OR- http://domain.com/example To: http://example.domain.com and From: http://www.domain.com/example/newfolder/file.html?q=blank -OR- http://domain.com/example/newfolder/file.html?q=blank To: http://example.domain.com/newfolder/file.html?...

How to use .htaccess to redirect fake subdomain with/without 'www'

I've searched here through many posts for this but can't seem to find a solution that works for me. I'm sure this is due to my lack of knowledge when it comes to .htaccess. Here is the problem. A client printed marketing materials with subdomain vanity urls (i.e., www.newproduct1.client.com) for the purpose of tracking via Google analyt...

URL Rewrite in htaccess problem

Am rather new to this world of htaccess redirects.Am trying to force all redirects in my Zend MVC to my https but I get a requested URL not found error on requests that dont go though the index controller Example https://www.example.com/auth/register gives a requested URL /auth/register not found error. However if I remove the https ...

Apache IpMatch?

Apache allows to apply certain configuration using FileMatch, Location and the rest. Is it possible to apply a certain configuration using IP as a condional Something like this: # some rules here. ...

Images logging as 404s with Zend Framework

Hello, Due to Zend rewriting URL's to module/controller/action, its reporting that images are coming through as a 404. Here is the error: [_requestUri:protected] => /images/Movie/124/thumb/main.png [_baseUrl:protected] => [_basePath:protected] => [_pathInfo:protected] => /images/Mov...

Pointing non-www to a spcific sub-directory

I might be going about this all wrong so let me know if I am. I am creating software that allows people to sign up and have their own sub-domain on my website. So say my website is ben.com, they could have their own sub-domain called juice.ben.com. When they type their sub-domain juice.ben.com in their address bar, it will load the c...