mod-rewrite

Images can not be found after using mod_rewrite

Hi, In order to make nice and friendly SEO links I'm using this: Options +FollowSymLinks RewriteEngine on RewriteRule ^([a-zA-Z0-9_-]+)/([a-zA-Z0-9_-]+)\.html$ page.php?ida=$1&idb=$2 [QSA] So http://www.example.com/solutions/hardware.html will be: http://www.example.com/page.php?ida=solutions&idb=hardware This works. But the pro...

mod_rewrite ignored/not working

I am having some issues with mod_rewrite on a new Apache dev PC I have set up. I have enabled mod_rewrite as an apache module and editted the conf file to allow rewriting, however when I try creating rewrites nothing happens. The htaccess file is being invoked to some extent as I am able to cause a 500 error by putting invalid syntax i...

Why is $_SERVER['PATH_TRANSLATED'] repeating itself?

I'm trying to create a MVC framework when I noticed the $_SERVER['PATH_TRANSLATED'] variable is doing this: [PATH_INFO] => /test/test2/test3 [PATH_TRANSLATED] => redirect:/index.php/test/test2/test3/test2/test3 This is when I'm accessing the PHP file by http://domain.tld/test/test2/test3 Notice how it is repeating after /test/ T...

Converting an ExpressionEngine rewrite rule for and NginX server

I'm trying to migrate a working ExpressionEngine installation from an Apache environment over to an NginX environment on a different box. I have come across a problem trying to convert some .htaccess rewrites to NginX. The site uses the multi language module so needs a custom rewrite rule for every additional language. This is my stand...

mod_rewrite in apache

Hello. I have image hosting. All image requests redirect to a PHP script with mod_rewrite. PHP script uses function fread() and displays picture from another file. I want to know, does this use a lot of processor time or not? ...

Apache rewrite URL but don't rewrite certain folder

I am using Apache to rewrite my URLs into clean URLs. RewriteRule ^(.*) index.php Currently this rewrites directories too, which is what I want, since I want everything run through my router/index.php file. What I would like to do however, is have one folder that I can access directly. This is for lib files such as .js and .css file...

appending a paremeter with .htaccess

Hi all, i'm struggling with an htaccess rewrite command what I have is RewriteCond %{HTTP_HOST} ^www.mywebsite.co.uk$ RewriteCond %{REQUEST_URI} !^/subfolder/ RewriteRule ^(.*)$ /subfolder/ I have a few URLs going to the same folder, some of them redirect to subfolders, which then run different templates. However, I also need to ap...

Redirect *.php to clean URL

My htaccess doesn't quite work: RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)\.php$ /blah/$1 [R=301,L] RewriteRule ^(.*)$ /blah/index.php/$1 [L] Basically /blah/about.php should redirect to /blah/about I'm using codeigniter so the last line is required to process URL's. Th...

Regex extract number for RewriteRule

For http://macintosh.local/clientname/102 I can get the numeric reference (3 digits) like this: RewriteRule ^[^/]+/([0-9]{3}+)/?$ album.php?ref=$1 [L] Now I want to get my reference in my SEO URL: http://macintosh.local/clientname/102-some-keywords ...

Mod_Rewrite change GET value pairs into nice slashes.

I have a url http://domain.com/module/controller/action/get1/value1/?get2=value2&get3=value3 I want to use Mod_Rewrite to change the ?&= to appropriate / slashes inline with the first GET variable. I also need to avoid conflicts with my current Mod_Rewrite rules: RewriteEngine On RewriteCond %{REQUEST_FILENAME} -s [OR] RewriteCond ...

redirecting url without www to www

Hello I need your help. I want to test if the url is entered without www like example.com it should be forwarded to www.example.com ...

Help with mod_rewrite

Should request: site.ru/index.php?go=23&page=bla alter the form: bla.site.ru/index.php?go=23 That is, the user types in browser bla.site.ru/index.php?go=23 and all information is passed to scripts that request site.ru/index.php?go=23&page=bla It is prohibited to use redirect ...

What is the correct mod rewrite rule to use?

I have a website deployed on two hosts: one in the root path the other one in the sub path For example http://one.example.com/xyz => maps to /var/www/ http://two.example.com/subpath1/subpath2/ => maps to /var/www/subpath1/subpath2/ Now I want to permanently redirect abc.php to index.php on the hosts http://one.example.com/xyz/abc....

Rewriting rails url from port 3000?

i have an applicaiton that runs at actionengineers.com:3000. How do i reqwite the application to a subdomain or directory (actionengineers.com/myapp) without disturbing the main site of course. i tried to use .htaccess file but i allways get eror 404. here is the code in the .htaccess file. RewriteEngine on RewriteCond %{HTTP_HOST} ^www...

Rewrite rules for wordpress 3.0 (multi-site) for nginx?

This is the new version being used by wordpress... RewriteEngine On RewriteBase BASE/ #uploaded files RewriteRule ^(.*/)?files/$ index.php [L] RewriteCond %{REQUEST_URI} !.*wp-content/plugins.* RewriteRule ^(.*/)?files/(.*) wp-includes/ms-files.php?file=$2 [L] # add a trailing slash to /wp-admin RewriteCond %{REQUEST_URI} ^.*/wp-admin...

mod_rewrite rewrite_rule syntax question

I have the following in my .htaccess currently- <IfModule mod_rewrite.c> RewriteEngine On RewriteRule ^go/([^/]*)/([0-9]+)/([0-9]+)/?$ http://foo.com/wp-content/plugins/foo/cloak.php?post_id=$2&amp;link_num=$3&amp;cloaked_url=$0 [L] RewriteRule ^go/([^/]+)[/]?$ http://foo.com/wp-content/plugins/foo/cloak.php?name=$1&amp;cloaked_url=$0 [...

Trailing dots being stripped from URL

I've got a url - http://callisto/news/1st_February_is_here... - which has three trailing dots, but by the time it gets passed through mod_rewrite and reaches the script (in $_GET) the dots have been removed (but the rest of the string is OK). This is the htaccess rule: RewriteRule ^([^/]+)/(.*)$ index.php?__action=site&__filter=$1&__pa...

.htaccess redirect to page with anchor link

I'm trying to set up a .htaccess file to redirect pages from one domain to another. Works in 99% of cases, the RewriteRules that aren't working are like the one below - if the outbound URL has an #anchor tag, the # symbol is converted into the characters %23 in the browser and then the page does not load at the anchor. Any idea on how to...

Using Apache Rewrite to go from HTTP to HTTPS and vice-versa, but I get a 302 response and my app errors out.

I really hope someone knows what I'm doing wrong here, cuz I sure don't! We have a certain page on our site which has account balance information on it, and we want to make it secure with SSL. But we only want this one particular page to be secure. I have the following in the localhost:80 virtualhost, and it works perfect: RewriteCon...

Drupal: how rewrite all urls so that the instal directory isn't included in the link

I installed drupal on my site at say, example.co.uk/portfolio. All the links are showing as example.co.uk/portfolio/project-1. I want it to be example.co.uk/project-1 How can I use rewrite rules or whatever so that wherever there is a link that has the /portfolio directory showing, that it will not show it in the href at all? I want t...