mod-rewrite

.htaccess get url to uri segments

I want to convert the url: http://example.com/calendar/?start=1281052769&end=1283731169 into the url: http://example.com/calendar/1281052769/1283731169 This is what I have tried: RewriteEngine on RewriteCond %{QUERY_STRING} start=(.*) RewriteCond %{QUERY_STRING} end=(.*) RewriteRule ^calendar$ http://example.com/c...

What's wrong with this MOD Rewrite Rule?

# Tags RewriteRule ^tags/(\d+)/$ /tags/view/index.cfm\?tagURL=$1 [L] the tag can be anything. What's wrong? ...

agh - mod_rewrite remove '-xxx-XXX' from URL

hello - bit of a nightmare. Clients sent out a big email with in links in them which have subsequently changed! just need to change forthcoming-events/event/skills-xxx-XXX to forthcoming-events/event/skills so just removing the '-xxx-XXX'. Any help majorly appreciated as struggling to find a solution. ...

Apache RewriteRule: preserve Query String and Add new parameters

Hi, I'm not sure whether this is the origin of the bug I'm trying to solve, however, I'm still not sure I correctly understood Apache doc... Let's say I wanna redirect toto.page?a=2&c=546EUE&stuff=blah to index.page?view=Blahblah/Toto&a=2&c=546EUE&stuff=blah Of course, if there was other parameters, they should be preserved too. Is ...

.htaccess File Causing JS and CSS Files From Being Called

Hi, I have an .htaccess file working in my website. I found out that javascript and CSS files are not called if the path of each of these files are not set to absolute. I changed all the URL paths to absolute in my smarty template and javascript files, and not it's working. Now in for my php files, I have require_once all over many ph...

How to apply output rules to script tag's content in IIS7 rewrite module v2?

Hi, I want to specify that my output rule should only apply to the contents of a tag... the predefined tags allow me to change the url of the src attribute of the script tag, but I want to change any URLs specified within any snippets of javascript embedded in my page. I've looked at using custom tags for this, but it still seems to b...

apache url rewrite problem

Hi all, is it possible to rewrite the following URL: http://dev.aurora.com/problem/getproblems/fieldset/2?search=false&rows=20&page=1 to http://dev.aurora.com/problem/getproblems/fieldset/2/search/false/rows/20/page/1 Thanx in advance ...

htaccess RewriteRule problem

Hello, I have a problem with RewriteRules. I'm currently using this rule: RewriteRule ^([^/.]+)/?$ index.php?clip=$1 This works fine for links as these, where $_GET['clip'] is the value after the slash: http://example.com/abcdefg But not for those with a dot character, like these: http://example.com/abcdefg.png How should I chang...

help with mod-rewrite for REST API (kind of like the twitter API)

I've got a question for the mod-rewrite gurus out there :p I've got a REST api built, I'm just working on the .htaccess mod-rewriting for some nice URLs. I would like this... api.site.com/[contacts].[json]?location=[new york,NY] To map to this... site.com/includes/api/v2/api_receiver.php?action=[contacts]&format=[json]&location=[new y...

RewriteCond/RewriteRule with case-insensitive and trailing slash functionality?

Hi! I got problems with the following two lines: RewriteCond %{REQUEST_FILENAME}.html -f RewriteRule ^(.+[^/])$ /$1.html [L] Goal: Redirecting "domain.tld/test/" (only if test.html exists) so that it outputs the contents of "domain.tld/test.html". How to make this case-insensitive: "domain.tld/Test" -> domain.tld/test.html ** How to...

mod_rewrite prefix problem

Hello, I'm having some difficulties with mod_rewrite. My directory structure (part of it) is: index.php .htaccess app controllers models views ... public javascripts stylesheets foo bar So, as you can see, all static files are in app/public. That's the reason I would like to route requests like: http://...

mod_autoindex does not respect mod_rewrite rules

I have a directory structure similar to: public_html/ example.com/ index.php subdir/ file.jpg I'm using shared hosting, so http://example.com maps to /public_html/ for its root, and I can't change this. I've added a mod_rewrite rule to handle this issue: RewriteEngine On RewriteRule ^$ example\.com/ [L] RewriteRule (....

How do I make .htaccess do what I want? :) (appending query string to url)

Currently my .htaccess looks like this... Options +FollowSymLinks RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ $1.php [L,QSA] It currently changes any /xxx.php file into /xxx. This is great for SEO. However, I also want Mr. htaccess to convert certain ...

Problems with Wordpress’ mod_rewrite rules when requesting existing files

Hey guys, please take a look at my .htaccess: # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L] RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L] RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L] Rewri...

OpenID AX, Google and mod_rewrite problem

I am trying to implemented an OpenID for our project(Zend, PHP, Apache), and hitting a weird problem. After user authenticates at the provider's side and is sent back to our website, apache gives 500 Internal Server Error response. Logs are completely blank. I've noticed though that when using OpenID AX with Google, they returning way to...

Displaying update page once

I am in the middle of developing a new website with my existing site still up and running. What I want to do is redirect the user to an update page when they visit the existing site (regardless of what page they enter on) then redirect them from that update page to the original page they requested. I think the mod_rewrite rule would loo...

Wordpress, .htaccess and mod_rewrite: how can I add redirection rules?

At the moment, I have a standard installation of Wordpress 3.0, and the .htaccess file looks like this: <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> I want to rewrite URLs so that I...

Multilanguage site, subdirectories as language (RewriteRule)

Hi all, For my website i want to rewrite my url to: www.xxx.com/en/index.php instead of www.xxx.com/index.php?language=en www.xxx.com/nl/index.php instead of www.xxx.com/index.php?language=nl www.xxx.com should be www.xxx.com/en/ This actually works i have added these rewrite rules RewriteCond %{HTTP_HOST}%{REQUEST_URI} ^www\...

RewriteRule to redirect requested URLs to a certain URL

Hello everyone, I want to redirect requested URLs that use subdomain such as anything.example.com to example.com, and I want the URL to remain anything.example.com. Currently I am using: ServerName www.example.com ServerAlias *.example.com RewriteRule ^/$ /homepage/ [P,L] It works fine this way. But when I remove the flag P it stops...

PHP Mod_Rewrite

I'm trying to use mod_rewrite to achieve the following rewrite: From - http:// pre.domain.com/public/?project=Awesome To - http:// pre.domain.com/project/Awesome Can't seem to figure it out (despite reading through endless sites). Any help? ...