mod-rewrite

cakephp .htacccess with multiple domains

I have my cakephp .htaccess files set up as in the cookbook and everything is working fine. My web site currently has multiple domains, all of which point to the same site (e.g. www.site.com, www.site.co.uk). I'd like to set up a rule so that requests to www.site.co.uk/page are permanently redirected to www.site.com/page, etc. I'm havi...

redirect an internal IP from HTTP to HTTPS with Apache

Hey all- I have looked this up on here and Google but none of the suggestions seem to be working for me. I'm working on an internal site at this point so the endpoints are IPs vs URLs. Accessing the site via HTTPS works, but HTTP just says "Cannot establish a connection". I can't seem to find anything in the logs that explains why. I...

Is it possible to change the rewrite rules in asp.net mvc web.config using code?

I want to be able to add/update/delete rewrite rules from the web.config. Is this possible and are there any gotchas? ...

mod_rewrite local redirect on hostname

Hi, wonder if you can help me, I've got a hosting account (on GoDaddy for my sins) which has one domain name associated with it and a few more parked. If I visit: site1.com site2.com site3.com I get the contents of /httpdocs/ I want to redirect to a sub directory (locally) only so that if you goto site2.com, the URL stays as site2....

apache mod_rewrite redirect between hostnames (except one directory)

I've got two hostnames (e.g. www.site1.com and www.site2.com) mapped to the same apache virtual host. I'd like to redirect all traffic from site1.com over to site2.com, except for all POST requests from a particular folder. (That folder contains URLs which are used by older clients which are not capable of handling redirects on POST req...

htaccess RewriteRule redirecting unexpectedly www

In my htaccess I have a rule - I have this rule RewriteRule ^mk$ http://mysite.com/mypage.php [r=301,nc] and later on : RewriteCond %{HTTP_HOST} !^mysite\.com$ [NC] RewriteRule ^(.*)$ http://mysite.com/$1 [QSA,L,R=301] This works fine for http://mysite.com/mk - it redirects to: http://mysite.com/mypage.php as I wanted. ...bu...

Problem with multiple CodeIgniter installations on shared HostGator servers

I have a shared hosting plan with HostGator and multiple CI installations. For each installation, I've been able to successfully remove the "index.php" from the URL, but on my addon domain, none of my CSS, or JS, or image files load correctly. Here is what I have for mod rewrite on the main domain: RewriteEngine on RewriteCond $1 !^(i...

.htaccess 404 errorDocument problem

I have this in my htaccess: Options +FollowSymLinks Options -Indexes RewriteEngine On RewriteRule ^annons/([a-zA-Z0-9_]+)$ ad.php?ad_id=$1 [NC] ErrorDocument 404 /404.html This all works, except for one problem. When I write an adress that doesn't exist like this: http://www.domain.com/some_adress_that_doesnt_exist then the 404...

Mod rewrite problem: rewrite url with drupal

Hi, Im am working on a drupal website with acqui solar search. I have to use this url /search/apachesolr_search/, but I want to change it to 'search' instead. If u create an alias, my search doesn't work anymore... Can someone help met to write a function for the 'Mod rewrite' module or give another option? Thanks in advance ...

robots.txt and Mod Rewrite in .htaccess

In the robots.txt file, I am about to disallow some sections of my site. For instance, I don't want my "terms and conditions" to be indexed by search engines. User-agent: * Disallow: /terms The real path to the file is actually /data/terms_and_conditions.html But I have used .htaccess to rewrite the URL. Now to my Q, should I ...

Possible infinite loop in mod_rewrite?

I am working on overhauling the URL structure of review pages, which can be filtered by city, county, # of stars and technician. I want to make the pages look like they are static HTML pages as well as replace pluses with hyphens. My goal: -Apply the new style URL's without modifying the reviews page, just the htaccess file -Set up 301 r...

Random video at static URL

I need to provide a static url to a client, eg. http://domain.com/video.mp4. However this URL needs to provide a random video from a selection of 5 videos each time it is accessed. Is this possible using PHP and mod_rewrite? Or some other way? Thanks ...

.htaccess exception for several subfolders

Hello I am having some troubles with my script.. when I access http://www.domain.com/this-is-a-topic I want it to redirect to http://www.domain.com/index.php?t=this-is-a-topic... BUT when it says "administration", "sitemap" or some other things, I want it to look either another rewrite condition or simply just get http://www.domain.com...

.htaccess code to redirect old blog urls to new blog urls on a new domain

I'm trying to redirect an old wordpress blog to a new posterous blog using an htaccess file and I am using the code below; the problem is that I can't get the old individual blog posts to redirect to the new ones - they have the same name structure on the new domain name (eg: olddomain.com/post-1 is now newdomain.com/post-1), but if I ty...

Apache 2 mod_rewrite problem

<IfModule mod_rewrite.c> RewriteEngine On RewriteRule ^browse/videos/(.*)/(.*)/(.*)/(.*) /videos.php?sortby=$1&filter=$2&page=$3&title=$4 RewriteRule ^videos/(.*)/(.*) /playvideo.php?videoid=$1&title=$2 </IfModule> url www.example.com/browse/videos/z/0/1/LastAdded goes to videos.php but url www.exaple.com/videos/10/play.html also go...

.htaccess mod_rewrite

hello i am trying to make it so that when you visit my site you don't have to put .php at the end this is what i am using but it isn't working (godaddy hosting) Options +FollowSymlinks RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME}\.php -f RewriteRule ^(.*)$ $1.php i just added the "Options +Follo...

QUERY_STRING in .htaccess While redirecting

How can I allow visitors to use this link (www.example.com/news?id=34) in order to see (www.example.com/index.php?page=news&id=34) Right now I am hiding the extensions of my PHP files in order to make the links look nice. When visitors go to (www.example.com/news) they can see the page (www.example.com/index.php?page=news). However, whe...

Mod Rewrite not working on my addon domain

I have a wordpress website on my main domain For the wordpress website i have this in my .htaccess file # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php </IfModule> # END WordPress I just created an addon domain ...

How do I rewrite a URL in IIS?

What would be simplest way to get this functionality in my website. A small example code will be appreciated. ...

How would I use mod_rewrite to turn this query string request in to a clean url?

How can I use mod_rewrite to take http://www.site.com/events?pg=4 and turn it to a clean URL, like so: http://www.site.com/events/4 ? Thanks for the help! ...