rewrite

.tpl files and website problem

Apologies if the title is in lowercase but it's describing an extension format. I've started using Dwoo as my template engine for PHP, and am not sure how to convert my PHP files into .tpl templates. My site is similar to, but not the same as, http://library.digiguide.com/lib/programme/Medium-319648/Drama/ with its design (except colou...

nginx - redirect a certain path to another domain

Hey there. I am very unfamiliar with nginx, as a forewarning, and also can't find any actual references on the regex system they use. So right now it's a black box to me. All I want to do is redirect a user trying to go to www.mydomain.com/mydirectory/X to www.myotherdomain.com/X . Seems like I should be using the rewrite command but ...

Apache redirect based on host and uri

I have a fairly simple redirect rule setup in my Apache vhost. <VirtualHost *:80> ServerName mobile.foo.com ServerAlias *.foo.com RewriteEngine On RewriteCond %{HTTP_HOST} ^(.*)\.foo\.com$ RewriteRule ^(.*)$ http://mobile.bar.com/foo [R=301,L] </VirtualHost> I want to add another condition based on the request uri...

How do I redirect a not found FLV file to a 404 FLV file, using .htaccess?

Using .htaccess, how do I permanently redirect all not found *.flv files in one directory to a 404.flv file in the same directory. For example: If this file is not found: example.com/flv/*.flv Use this file: example.com/flv/404.flv Here's what I have so far (I'm very bad): RewriteCond /flv/(.*).flv !-f RewriteRule ^ /flv/404.flv [L,R...

URL rewrite using .htaccess

I need a url like mydomain.com/myname/?action=post&data=10 here in a single php page(user.php) i need all 'myname','post' and '10' as get method variables. How can i get it using .htaccess???... plz help me..... ...

Apache Rewrite - put parts of query string in replacement string

Hello, I'd like to rewrite: www.example.com/file.html?username=john&number=1234 To: www.example.com/users/john But I can't figure out how to extract the "username" value from the query string. I've been Googling this all morning and reading the official docs but no luck. I need to solve this problem with a rewrite, rather than chang...

mod_rewrite: remove trailing slash (only one!)

Hello. I use mod_rewrite/.htaccess for pretty URLs. I'm using this condition/rule to eliminate trailing slashes (or rather: rewrite to the non-trailing-slash-URL, by a 301 redirect; I'm doing this to avoid duplicate content and because I like URLs with no trailing slashes better): RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{RE...

.htaccess file: Dynamic redirect

Hi! I've had a hard timing learning rewrite rules in .htaccess files, so I was hoping someone could show me how to rewrite this: test.com/home/feed/toak/nyheter/vg into this: test.com/index.php?r=home&f=feed;toak;nyheter;vg This is a dynamic URL, and can have multiple elements seperated by ; in the end. I want my users to be able to...

mod_rewrite: remove trailing slash (only one!)

Hello. I use mod_rewrite/.htaccess for pretty URLs. I'm using this condition/rule to eliminate trailing slashes (or rather: rewrite to the non-trailing-slash-URL, by a 301 redirect; I'm doing this to avoid duplicate content and because I like URLs with no trailing slashes better): RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{RE...

How do I rewrite / to /blog in IIS 7?

I'm having trouble constructing the correct rewrite rule. Here's what I need the rule to do: http://www.mydomain.com/this-is-my-page http://www.mydomain.com/blog/this-is-my-page ...

Tomcat session management - url rewrite and switching from http to https

I'm an old hand at C but a raw newbie at Java/Tomcat. I'm fine with Tomcat session management in http alone. Its when I've come to look at switching to https that I've had problems. I gather for Tomcat that you have to start with an http session if you want to maintain a session as you switch from http to https and back to http. This ...

How can I easily fixup a past commit?

I just read amending a single file in a past commit in git but unfortunately the accepted solution 'reorders' the commits, which is not what I want. So here's my question: Every now and then, I notice a bug in my code while working on an (unrelated) feature. A quick git blame then reveals that the bug has been introduced a few commits a...

Helicon Isapi re write not working on shared hosting

Hi all, I have a shared hosting solution, and I am trying to use Isapi re write with it. I have two problems, the first is that when I use a .htaccess file i get an error abot IIS password not working. I think this is because there is a service called iis password installed that looks for a .htaccess file first. (I don't know what it d...

Negating certain words from a custom rewrite expression?

Hi. I have a WP page named Book (/book/) which displays a book in various languages. The language and chapter variables are passed as query variables. So the URL structure looks like: /book/english/ (This displays a list of chapters in English) /book/english/foreword/ (This displays the Foreword of the book in English) Here is what I h...

Custom Taxonomy + Custom Post Type in Wordpress Permalinks ?

Is it possible to get a Wordpress URL to look like this: /%post-type%/%custom-taxonomy%/%postname%/ I can get everything but the middle. Any ideas? ...

Need regex help with 2 URL rewrite cases (for SQUID server using SQUIRM)

case 1: IN: example.com?p1=val1&p2=val2&p3=val3 OUT: example2.com?p1=val1&p2=val2&p3=val3&p4=val4 -- p4=val4 was added to the end, the rest of the parameters were preserved case 2: IN: example.com?p1=val1&p4=badvalue OUT: example2.com?p1=val1&p4=goodvalue -- the value of p4 was changed, so we need to scan for the existence of the ...

Possible to use sha1 with nginx rewrite module?

Hi, Was wondering if it's be possible to use sha1 as part of nginx rewrite rules. As in, for each file request, i'd like to redirect it to the sha1 hash of the file name. Haven't managed to find any references to this yet. Thanks! ...

Custom rewrite rules in Wordpress

Hi, I'm in trouble with the internal wordpress rewrite rules. I've read this thread but I still can't get any results: http://stackoverflow.com/questions/2210826/need-help-with-wp-rewrite-in-a-wordpress-plugin I explain my situation: 1) I have a page_template called 'myplugin_template.php' associated to a wordpress page called "mypage"...

[Wordpress] Permalinks that filter both categories and taxonomies

Is it possible to show posts filtered by both taxonomies and categories? I.e. I have two categories: “News” and “Reviews” I have a custom taxonomy called ‘actor’. Can I show all the posts filled in the “News” category and “Tom Hanks” actor? Or all the news related to “Russel Crowe”? Or all the reviews related to “Tom Cruise”? Actually ...

Nginx problem - failed (20: Not a directory)

I have some rewrites for the SMF forum and they work just fine. The problem I'm having is that they are filling up my error log with "failed (20: Not a directory)" messages. My rewrites are : location /forum/ { root /usr/www-data/domain.com/httpdocs; if (!-e $request_filename) { rewrite ^/index\.php/([a-z]...