mod-rewrite

.htaccess question - URL-rewriting.

Hello. I have an issue with URL-rewriting in .htaccess. Here is .htaccess file: RewriteEngine On RewriteBase /community/ RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^view-all-results$ forums/index.php?view=view-all-results [R=302] RewriteRule ^view-all-results/$ forums/index.php?view=view-all-r...

Unable to exclude directory from rewriting rules

Hi, I tried to do this in many ways, but I really cannot exclude directory "progress" from wordpress rewriting rules in .htaccess. I found many solutions but none of them seems to be working. .htaccess in root directory of wp contains: # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENA...

Using mod_rewrite to redirct using different get variables

Using mod_rewrite, how would I take urls like these: www.example.com/?foo=hello www.example.com/?foo=world and redirect them to urls like these: www.example.com/hello/ www.example.com/world/ Thanks ...

mod_rewrite: How to I permit a user with no redirection/rewriting

I'm working with mod_rewrite for Windows (via an ISAPI filter) and haven't yet seen documentation on how to set up RewriteRule to permit the existing url with no changes. RewriteCond %{HTTP_USER_AGENT} !.*iPhone.* [NC] RewriteRule () http://DontWantToRedirect/orAlterURL [R,NC,L] My goal is to create a rule to permit only iPhones with ...

Abusing Mod Rewrite for a clean file system, and pretty URLs.

I have a few php files that do a few different jobs. I'd like to change the way my clients access these php files to make it more clean for the end user. The Mod_Rewrite system has shown that it can do some pretty powerful things when in the hands of the right server admin. So I was wondering how far can you abuse the Mod Rewrite rules f...

apache rewrite url

Hi, I am trying to rewrite url and it fails. May I know what is wrong? can someone please enlighten me? I placed the code in .htaccess. I have enabled rewrite_module too. thanks. RewriteEngine On RewriteRule /place/^([a-zA-Z0-9])$ /placelink.php?lid=$1 For example: domain.com/place/xyz -> domain.com/placelink.php?id=xyz Update: I ha...

simple(?) htaccess rewriting issues

hello people, OK I have been messing about with URL rewriting for the last few days and seem to have come to a bit of a dead-end. I have come up with a few solutions that work on some servers and not others, and my hosting company (1and1 - be vary wary of these guys if you choose them as hosts) hasn't been able to help at all. My prob...

Mod_rewrite: easiest question? /admin should call admin.php

hey guys, i know there are dozens of questions like this out there but somehow they never tell you how to do the easiest thing. i simply wanna pass for instance /admin in my url and admin.php gets called. how can i do that? ...

Help in mod_rewrite

I'm lousy at regex and need a .htaccess rewrite rule for a following link "/eventi/123/title-of-the-event" to "/dogadjanja/123/title-of-the-event". Thanx. ...

apply mod_rewrite in virtual host

Dear all, i would like to rewrite url in virtual host. Virtual directory : htdoc/dev/ , dev.com syntax in .htaccess in htdoc/dev <IfModule mod_rewrite.c> RewriteEngine On RewriteRule test.html$ test.php [L] </IfModule> I am able to rewrite test.html to test.php in localhost. However, not able to do it in virtual host. What went wron...

htaccess 301 redirect entire site but with exceptions

I am trying to create an htaccess file to redirect my entire site except with some exceptions, but I can't get it working. I need to redirect the entire thing, provide a specific redirect, and exclude two pages. Below is my non-working sample. Thanks! RewriteCond %{REQUEST_URI} !^/events/index.html RewriteCond %{REQUEST_URI} !^/calendar...

url rewriting problem

in my .htaccess file i have the following Options -Indexes RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)/(.*)$ index.php?lang=$1&id=$2 [L] so when i wrote http://mydomain.com/am/home it will be redirected to http://mydomain.com?lang=am&amp;id=home but i have a cms folder, and i need to go to http://my...

set default on webpage

Dear all, I have an issue with url direction here. I have used mod_rewrite in apache to rewrite the url from domain.com/page.php to domain.com/path/page.php. I have some link in the webpage for example href="newpage.php" will automatically go to domain.com/path/newpage.php instead of domain.com/newpage.php. May I know is there any php ...

Apache mod_rewrite: rewrite ^(.*)\.html$ to $1.php and forbid direct access to ^(.*)\.php$

My intent is to rewrite urls ending in .html to .php (not actually all of them, but that shouldn't really matter with regard to this question). I'd also like to disallow urls ending in .php (so that the user can access every page only using urls with .html extension). I'm using these rules inside .htaccess: RewriteRule ^(.*)\.php$ $1.h...

Mod Rewrite Newbie in CodeIgniter

I'm pretty new to mod-rewrites, and I'm having trouble getting this right: I'd like http://myurl.com/special and http://www.myurl.com/special to both redirect to http://myurl/index.php/special without changing the url for the visitor in their browser. currently, my .htaccess looks like this, to remove www from URLs <IfModule mod_rewri...

WordPress: Custom rewrite rules - .htaccess or functions.php?

I'm going crazy. The only thing I want to do is add these rules to the site that I'm developing: fastigheter-spanien/x property/X&lang=sv fastigheter-usa/x property/X&lang=sv properties-spain/X property/X&lang=en properties-usa/X property/X&lang=en Where X is the name of the post. These are all custom post types. The reaso...

Mod_Rewrite existing file check goes pear shaped, or passes wrong querystring.

I'm using Apache, Python (fastcgi), mod_rewrite. I want http://foo/bar to redirect internally to http://main.py?q=foo/bar Now my .htacess file contains Options +ExecCGI AddHandler cgi-script .py DirectoryIndex main.py RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule (.*) mai...

mod_rewrite on substring in URL

I'm forcing HTTPS on my site using mod_rewrite but I want to change this to HTTP for any URL with the substring com_bookmangement in the URL. So http://www.example.com/index.php?option=com_content&amp;view=article&amp;id=85&amp;Itemid=140 will be directed to https://www.example.com/index.php??option=com_content&amp;view=article&amp...

URL Rewriting Problem for a Beginner

I'd like to have all requests to http://example.com/controller redirected to http://example.com/index.php/controller without changing the url, and this is what my .htaccess file looks like: # Customized error messages. ErrorDocument 404 /index.php # Set the default handler. DirectoryIndex index.php # Various rewrite rules. <IfModule m...

Trying to hide a part of the url with mod_rewrite

Hi, I'm attempting to hide a part of an url from the address, because it's useless mouse coordinates sent due to input type="image" The URL is: www.example.com/search.html?mode=fulltext&query=HelloWorld&ssubmit.x=0&ssubmit.y=0 I want to hide the ssubmit.x and ssubmit.y part. I tried adding the following rule to .htaccess, but withou...