mod-rewrite

HTTP to HTTPS using mod_rewrite

Guys, I'm looking for a simple way to have this done. I would to have the .htaccess file rewrite to HTTPS if this is typed in the address bar: www.example.com example.com http://www.example.com I would like any of these potabilities redirect to https://www.example.com Thanks guys... I haven't found anything for this situation. Jus...

Helicon ISAPI Rewrite + ASP.NET : How to remove . aspx extension?

How do i remove .aspx extension like: http://www.foo.com/bar --> http://www.foo.com/bar.aspx http://www.foo.com/bar?q=boo --> http://www.foo.com/bar.aspx?q=boo ...

Helicon ISAPI Rewrite + ASP.NET : What is best practice to structure .aspx pages in solution when using URL Rewriting?

I have folder structure in solution like: /Pages /Articles - ArticleListing.aspx - ShowArticle.aspx /Master.master I have my navigation bar in Master page. Navigarion bar has URLs like: Latest Articles(href="article/") Article1(href="article/Article-Title") But when i access inner pages like ArticleListing.aspx o...

htaccess rewrite help needed, url /123 to /123/

Hi, Currently we have rewrite configured to make urls like: /wallpaper/123 but would instead like the rewrite to /wallpaper/123/ Problem: I need the existing links to be redirected properly from "/wallpaper/123" to "/wallpaper/123/" Current htaccess: Options +FollowSymLinks Options -MultiViews <IfModule mod_rewrite.c> RewriteEngine...

cakephp & httpd.conf issues on windows based apache server (wamp)

So, i was wondering if some one could clarify following occurrence and maybe suggest how I could tackle this. sorry for the weird coloring of the code Let me explain the set up first. I have wamp server installed and it is located physically on one hd and then my development files are located on separate hd. So i have added alias to ac...

Helicon ISAPI Rewrite + ASP.NET : Rewrite rule to redirect to default page?

How do i rewrite URL like: http://subfoo.foo.com/ --> http://subfoo.foo.com/Pages/Home.aspx ...

How to Rewrite URL like: www.foo.com/tags/tag1+tag2 --> www.foo.com/Pages/Articles/ArticleListing.aspx?tags=tag1+tag2

How to add single rewrite rule for- www.foo.com/tags/tag1 --> www.foo.com/Pages/Articles/ArticleListing.aspx?tags=tag1 www.foo.com/tags/tag1+tag2 --> www.foo.com/Pages/Articles/ArticleListing.aspx?tags=tag1+tag2 www.foo.com/tags/tag1+tag2+tag3 --> www.foo.com/Pages/Articles/ArticleListing.aspx?tags=tag1+tag2+tag3 ...

mod_rewrite with location-based ACL in apache?

Hi. There is a CGI-script that provides some API for our customers. Call syntax is: script.cgi?module=<str>&func=<str>[&other-options] The task is to make different authentiction rules for different modules. Optionally, it will be great to have nice URLs. My config: <VirtualHost *:80> DocumentRoot /var/www/example ServerNa...

Apache .htaccess redirecting directory to querystring

i would like to redirect requests on my site from host.com/directory to host.com/?institution=directory so that users can access the main level categories of my site using a directory notation I just have a hard time wrapping my head around the regex, any help would be appreciated ...

noob's problem with mod rewrite and relative urls

I must be doing something terribly wrong because no matter how i try or google it, i can't find an answer :( So, i want to have a url like http://localhost/BLUEPRINT/list/857 to actually load a perfectly working url like this: http://localhost/BLUEPRINT/list.php?lid=857 I can write the rewrite rule in the .htaccess file and i can read ...

Beginner Url Rewrite htaccess

I would simply like to rewrite all requests from: http://example.com/products/product.cfm?id=product-name to http://example.com/products/product-name and secondly, http://example.com/category.cfm?id=some-category&amp;sub=sub-category to http://example.com/some-category/sub-category Here is what I’ve tried: Options +FollowSym...

How to rewrite url using apache for mongrel?

I use mongrel to run a ROR website. My apps need to respond to urls generated by third parties. There is double quote in the url, and mongrel will error on such urls. Since I use apache on top of mongrel. How can I use the mod_rewrite in apache to encode the url? ...

how to generate slugs in php

hey guys im trying to write a script , that can rewrites urls in slug way such as this : http://www.mysite.com/mystorytitle/ and i did this in my codes : RewriteRule ^(.*)\/$ app=News&file=article&title=$1 [L] and in my php codes, i created a slug out of story's title as : $slug_title = mysql_real_escape_string($mtitle); ...

Another regex question with ISAPI-Rewrite

Hi, it's been a couple of hours now that I'm working on this and I can't seem to figure out what the correct regex is. First of all, I'm working with IIS6 and ISAPI_Rewrite 3.0 and I'm testing my regex with the utlity that comes with it before using it on the web site. The website has an web app located at www.foo.com/bar/ and I want t...

htaccess mod_rewrite how to rewrite empty vars

Hi Guys, I tried to create a htaccess file that rewrites, for example the URL from /index.php?type=car&model=audi&color=990000&year=1995 to /index/car/audi/990000/1995. At the moment i use the following: Options +FollowSymLinks RewriteEngine On RewriteRule ^([^/]+)/([^/]+)/([^/]+)/([^/]+)/([^/]+) $1.php?type=$2&model=$3&color=$4&year...

URL rewrite, getting error

I am having this in a .htaccess: RewriteEngine On RewriteRule ^videos/([0-9]+)/?$ vis_film.php?id=$1 [NC,L] My page is root/directory/directory/videos/vis_film.php?id=2 but i want it to be root/directory/directory/videos/2/ And ive placed the .htaccess file inside videos/, is that right? and what have i done wrong? ...

Updating .htaccess rewrite conditions

I'll like to update the following rewrite condition to only allow one particular subdomain. RewriteCond %{HTTP_HOST} !^domain.com$ [NC] At the moment, it matches all subdomains, but I'd like to allow just one - admin.domain.com. How would I do this? Thanks for any help in advance. ...

ANTLR 3.x - How to format rewrite rules

I'm finding myself challenged on how to properly format rewrite rules when certain conditions occur in the original rule. What is the appropriate way to rewrite this: unaryExpression: op=('!' | '-') t=term -> ^(UNARY_EXPR $op $t) Antlr doesn't seem to like me branding anything in parenthesis with a label and "op=" fails. Also, I've...

How do I express this with a RewriteCond?

I want to redirect users to an error page if they enter any URL not starting with 'en' or 'fr'. I cannot figure out how to express this as a RewriteCond / RewriteRule. To be clearer, some examples: http://mysite.com/en/foo/ ==> Cool, do nothing http://mysite.com/fr/foo/ ==> Cool, do nothing http://mysite.com/foo/ ==> ERROR, redirect t...

Using mod_rewrite with mod_vhost_alias

I was wondering if it's possible to use the vhost_alias module in conjunction with a rewrite rule. So in my VirtualHost I have this: VirtualDocumentRoot /var/www/%2+/%1 For example, sub.mydomain.com will point to /var/www/mydomain.com/sub/ But I want to check if the folder exists to avoid getting a 404 error if I try to reach a bogus ...