Search Results

Search found 3190 results on 128 pages for 'isapi rewrite'.

Page 46/128 | < Previous Page | 42 43 44 45 46 47 48 49 50 51 52 53  | Next Page >

  • RewriteRule being greedy

    - by lardlad
    I have been looking for an answer for a few hours now, so sorry if this was asked a ton of times, I missed it. I basically want to make a rewrite to ignore the first directory. That first dir in the path will be different so I thought I could use a regex. But my regex is matching all the way to the file name: RewriteRule ^([a-z]+)?/(.+)$ $2 [L] this works if I am one level deep: http://test.domain.com/one/index.php I get the actual index page of the root. Which is what I want. but if I were to go deeper: http://test.domain.com/one/two/index.php I get a message saying /index.php was not found. So it seems my regex is not stopping after the last [a-z]. I appreciate any help. This is Apache2 if that matters at all.

    Read the article

  • Apache rewrite_mod: RewriteRule path and query string

    - by 1ace
    I currently have a website with a standard web interface on index.php, and I made an iPhone-friendly version in iphone.php. Both pages handle the same arguments. It works fine when I manually go to .../iphone.php, but I'd like to rewrite anything on .../path/ and .../path/index.php to iphone.php if %{HTTP_USER_AGENT} contains mobile, and optionally add the query string (not sure if/when I'd need to add it). So far, this is what I have in my .../path/.htaccess: RewriteEngine On RewriteCond %{HTTP_USER_AGENT} ^.+mobile.+$ [NC] RewriteRule index.php?(.*) iphone.php?$1 [L] RewriteRule index.php iphone.php [L] The problems are, it matches index.php in any subfolder, and it won't match .../path/?args… Special thanks to anyone who can correct/simplify/optimize anything =)

    Read the article

  • htaccess rewriterule with order in url

    - by NRoscoe
    I'm trying to put together a rewrite rule for an Apache server. It should take 'order/###' and change it to 'order.php?id=###'. For some reason it's rewriting as 'order.php/###'. If I change it to anything other than 'order' my rule works fine. Anyone know what's going on? My .htaccess file looks like this: RewriteEngine on ## tighten host RewriteCond %{HTTP_HOST} !^mydomain\.com$ [NC] RewriteRule .? http://mydomain.com%{REQUEST_URI} [R=301,L] ## Dynamic Pages RewriteRule ^order/([0-9]+)/?$ order.php?code=$1 [L,NC] ## Static Page Redirects RewriteRule ^prices$ /prices.php [L,NC] RewriteRule ^examples$ /examples.php [L,NC] I have no access to the httpd main server config file on the live server.

    Read the article

  • Problem in enabling mod_rewrite in Ubuntu.

    - by Rajan
    Hi, I am trying to change from windows to linux server. And for that i am trying to enable mod_write in ubuntu. I have taken all the necessary steps to enable the mod_rewrite as mod_rewrite is displayed under loaded modules. I have set all the permissions for the .htacess file. But for some reason the rewrite does not appear to be working in the linux server. It was working fine while i was using the same code in windows server. Can anyone please help me in this issue. Your help will be really appreciated. Thanks. Rajan.

    Read the article

  • .htaccess stupid issue

    - by justnoone
    I have a server where I can only configure httpd using .htaccess, a cannot access global configuration. I want to rewrite almost every non-existing path to index.php, so I did something like: RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php?path=$1 [L,QSA] And that is ok. But another thing I want to do is to prevent access to path where I keep PHP files (I cannot store them somewhere else) which is for example /php. I would like that anything starting with /php rewrites to index.php?path=php... so I did something like: RewriteCond %{REQUEST_URI} ^/php.* RewriteRule ^(.*)$ /index.php?path=$1 [L,QSA] And that also would work ok if I had access to global configuration. In case of per-directory configuration, when I access /php it rewrites it to index.php?path=php and than puts directory name before that: /php/index.php?path=php. I read documentation and I realize that it uses internal redirects when per-directory confoguration is used. How can I avoid this behavior?

    Read the article

  • My mod_rewrite won't work, what's wrong?

    - by Tim Rogers
    I have the following rewrite rule, but nothing is hapenning at all when I try to use it. I have the file in the directory server.blahblahblah.com/todo and the following is my .htaccess file: Options +FollowSymLinks Options +Indexes RewriteEngine On RewriteBase / RewriteRule ^tasks/view/([0-9]+)?/$ controller.php?task=view&id=$1 RewriteRule ^tasks/view/([0-9]+).xml$ controller.php?task=viewxml&id=$1 RewriteRule ^tasks/new?/$ controller.php?task=new RewriteRule ^tasks/delete/([0-9]+)?/$ controller.php?task=delete&id=$1 RewriteRule ^tasks/completed/([0-9]+)?/$ controller.php?task=complete&id=$1 RewriteRule ^tasks?/$ controller.php?task=home Does anyone know why this won't work at all? Thanks, Tim

    Read the article

  • mod_rewrite and relative urls

    - by Davide Gualano
    I'm setting up some simple url rewriting rules using mod_rewrite and a .htacces file, but I've got some problems. If I set up the .htacces this way: Options +FollowSymLinks RewriteEngine On RewriteBase / RewriteRule /index.html /index.php [L] when I call from the browser this url: http://localhost/~dave/mySite/index.html I got a 404 error. Using this .htacces instead Options +FollowSymLinks RewriteEngine On RewriteBase / RewriteRule /index.html http://localhost/~dave/mySite/index.php [L] everything works fine and I get the index.php page I'm expecting. Am I forced to user absolute urls as the target of a rewrite? Is this a Apache configuration problem? I'm using Max OS X 10.6.2 with its standard Apache installation.

    Read the article

  • Zend Server CE Apache mod_rewrite REQUEST_FILENAME SCRIPT_FILENAME Problem

    - by liumiuyong
    Hi,there! I use this .htaccess file in a project: RewriteCond %{SCRIPT_FILENAME} !-f RewriteCond %{SCRIPT_FILENAME} !-d RewriteRule ^(.*)$ index.php/$1 [L] It works well in Apache 2.2 Recently I started to use Zend Server CE , the ReWrite Rule didn't work ! And this works: RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php/$1 [L] This is what Apache's document say: The variables SCRIPT_FILENAME and REQUEST_FILENAME contain the same value - the value of the filename field of the internal request_rec structure of the Apache server. The first name is the commonly known CGI variable name while the second is the appropriate counterpart of REQUEST_URI (which contains the value of the uri field of request_rec). Anyone can figure out why? Appreciate!

    Read the article

  • RewriteRule not working do not know how to test it the regex matches

    - by user564559
    Hello I have a Rewrite rule I am trying to implement on my local host but I cannot get it to do the action no matter how I setup the regex the files are in this naming scheme /docroot/css/stylesheet.min.css and I have them printed in the code like /docroot/css/stylesheet.min.123438348.css (the number is example it comes from a get modified function). Note docroot is an example directory how can I have the server ignore the numbers and redirect to the stylesheet.min.css I need to do this for every css and js files (/js and /css) as well as one specific spritemap image my current attempt RewriteRule ^/(docroot)/(js|css)/(.+)\.(min)\.(.+)\.(js|css)$ /$1/$2/$3.$4.$6 RewriteRule ^(/docroot/images/spritemap)\.([0-9]+)\.(png)$ $1.$3 I have this wrapped in a I am on linux..should this be mod_rewrite.so?"

    Read the article

  • Is there a major downside to using .htaccess files in your svn/git repository?

    - by Rob
    If our .htaccess files are purely for mod rewrites, is there a security / development downside to committing .htaccess files alongside other files in your repository? For various reasons (our SEO optimisers like to add pretty urls as new promotions occur, etc) we need a fair few rewrite rules inside these files. Would I be better off pushing the routing into php-land and dealing with it there? Or is reading from a .htaccess via apache fine? The .htaccess files are not exposed via the web server, so that's not a security risk.

    Read the article

  • Help with redirect and query strings

    - by James
    I'm a total novice at mod rewrite so I'll try and present my question as clearly as possible: I'm trying to create a url redirect of the following (static) affiliate url that can append it self to any product links after using a query string: affiliate url: hxxp://clk.affilite.com/fs-bin/click?id=aFb*BBBBBpQ&subid=&offerid=9999.2&type=5&tmpid=9999&RD_PARM1= product url: hxxp:// example.domain.com What I want to achieve is redirecting the affiliate code as below and being able to add dynamic product urls after as the following examples show: rewritten affiliate url: hxxp://domain.com/go affiliate url + product url: hxxp://domain.com/go?=http://example.domain.com redirects to: hxxp://clk.affilite.com/fs-bin/click?id=aFb*BBBBBpQ&subid=&offerid=9999.2&type=5&tmpid=9999&RD_PARM1=http://example.domain.com

    Read the article

  • mod_rewrite with GET requests

    - by iMaster
    I have mod_rewrite working on most of my site. Right now I have a search that normally would point to search.php?keyword=KEYWORD And I'm trying to rewrite that to search/?keyword=KEYWORD Just to make it a little bit cleaner. So here's my mod_rewrite. (There are other rules I'm just posting the one that isn't working.) RewriteRule ^search/?keyword=([^/\.]+)/?$ search.php?search=$1 When I type a search in the address bar way I want it to be, I get a page telling me its a "broken link" (I'm guessing that that's Chrome's equivalent of a 404 error). So what am I doing wrong? I think that the problem is the '=' or the '?' sign in the rule (the first part) because when I take the ?keyword= part out, it works. Does that make sense?

    Read the article

  • problem with .htaccess and mod_rewrite

    - by ian
    My below .htaccess file should send everything to my index.php page where my framework [Fat Free Frameowkr] handles it. However if I go to http://www.site.com/ it works. If I go to http://www.site.com/about I get a 404 error. Any ideas? # Enable rewrite engine and route requests to framework RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-l RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule .* index.php [L,QSA] # Disable ETags Header Unset ETag FileETag none # Default expires header if none specified (stay in browser cache for 7 days) <IfModule mod_expires.c> ExpiresActive On ExpiresDefault A604800 </IfModule>

    Read the article

  • mod_rewrite per-dir redirection returning a 400

    - by Eaterrust
    I moved my images directory to a different folder, and now I want to redirect all images requests from that folder to the new one. I do not have access to the main configuraion file, so I'm doing this in a .htaccess. I tried this, and it works:     RewriteCond %{REQUEST_URI} old_dir/.+.(jpg|png|gif)$     RewriteRule old_dir/(.+[^/]+..+)$ $1 [L,PT] But since they have permanently moved, I want to do a proper redirect, so I added the [R] flag, like this:      %{REQUEST_URI} old_dir/.+.(jpg|png|gif)$     RewriteRule old_dir/(.+[^/]+..+)$ $1 [L,PT,R] But the server gets confused, and returns a 400, so I looked at the log file, and this is what happens:     strip per-dir prefix: C:/wamp/www/natrazyle/old_dir/images/banner.jpg - old_dir/images/banner.jpg     applying pattern 'old_dir/(.+[^/]+..+)$' to uri 'old_dir/images/banner.jpg'     rewrite 'old_dir/images/banner.jpg' - 'images/banner.jpg'     add per-dir prefix: images/banner.jpg - C:/wamp/www/natrazyle/images/banner.jpg     explicitly forcing redirect with http://localhost/C:/wamp/www/natrazyle/images/banner.jpg As you can see, the full local path gets added after localhost I know I'm doing something wrong, I just can't figure it out myself. Any help would be greatly appreciated...

    Read the article

  • Using Mod_Rewrite in HTTPD.CONF file

    - by Mike Lovely
    I want to rewrite URLs so when a user goes to; http://www.example.com/applications/newWeb/www/index.php?page=48&thiscontent=2660&date=2013-10-11&pubType=0&PublishTime=09:30:00&from=home&tabOption=1 and if the URL contains thiscontent=2660 (which in this example above, it does) I want to redirect them to; http://www.example.come/index.php/publications/finance-and-economics/departmental-resources I have about 30 different thiscontent=XXXX types and imagine I’ll have to copy and edit this rule 30 different times for any links to my old website still knocking around out there. I have access to my httpd.conf file but have never done a mod_rewrite before. I also don't really need these showing up in the error logs as 301s. Will that happen? Because at the moment there are hundreds!

    Read the article

  • mod_rewrite rule for all urls except ones with some words

    - by zlog
    How do I write a mod_rewrite regulare expression rule that is the opposite of this: ^(.+)/path/(page1|page2)+$ ie, I want all pages except blah/path/page1 and blah/path/page2 to redirect to another path, where the x in blah/path/x is used in the new path. For example, I'd like write a rewrite rule like: RewriteRule some_regex /index.php?path/show/$1 [L] where some_regex would pull out the last component of a url in the format: /something/path/some_param to redirect to /index.php/path/show/some_param I'm trying to use ! and [^] syntax, but I don't quite understand how these work, especially when they involve words not single characters.

    Read the article

  • Redirecting to a new site unless in a specified directory

    - by Luke Strickland
    Hello. I run an image hosting site. Lets just go with the following information. Site: imagehosting.com Tiny: imgho.st Directory: n/ Directory is where the images are stored. Anyways. I'm trying to figure out an apache rewrite method to redirect imgho.st to imagehosting.com UNLESS in the n/ directory. So unless the user is imgho.st/n/83md.png redirect to imagehosting.com. Could anybody help me out with this? Thanks!

    Read the article

  • How to allow three optional parameters in the URL by .htaccess?

    - by eij
    I have http://example.com and a PHP routing class that checks if some URL exists. I want to make a new route, which is: http://example.com/foo/bar/123 but as long as I open it, the Apache redirects me to an error page. So I'm using a .htaccess. The code is: RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*) /index.php [L] and it works, as long as I use http://example.com/foo, but once I add some other parameters, it redirects me to an error. I'm guessing that the rewrite code is wrong. Is it wrong? If yes, could you suggest me the good one? If no, where the problem could be located?

    Read the article

  • not rewriting .asp files using htaccess

    - by user2939099
    I have .asp files re-writing themselves to .php files using htaccess and a rewrite rule on another site. it works fine but I am trying to do the same on my other site with one URL and it doesn't work. both have mod_rewrite enabled and on similar servers. (Apache v3.22.17 rev9999 / PHP v5.4.21) <IfModule mod_rewrite.c> RewriteEngine On RewriteRule ^(.+).(asp)$ $1.php [L] </IfModule> this is the full htaccess code.. can you see anything wrong with this?

    Read the article

  • mod_rewrite replace all instances of ampersand with %26 for later

    - by Supernovah
    Hey there! I want to simply not use ampersand in my URL so I can pass ampersands further down into my system when a file is requested. The problem is Apache deals with it differently. I don't know how I already rewrite the requested file to index.php?url=$1 so I can see what it was, but if it has an ampersand in there, it can't continue past it! how can I escape the ampersand or turn it into it's hex equal (%26)? <IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ index.php?url=$1 [QSA,L] </IfModule>`

    Read the article

  • Htaccess rewrite rule .aspx to .php

    - by Markus Ossi
    Background: I have a website that has been built with ASP.NET 2.0 and is on Windows hosting. I now have to rewrite my site in PHP and move it into Linux hosting. I have a lot of incoming links to my site from around the web that point directly into the old .aspx-pages. The site itself is very simple, one dynamic page and five static ones. I saved the static .aspx pages as .php-pages and rewrote the dynamic page in PHP. The dynamic page is called City.aspx and I have written it in PHP and it is now called City.php. On my old Windows hosting, I used ASP.NET's URL mapping for friendly URL. For example, incoming URL request for Laajakaista/Ypaja.aspx was mapped into City.aspx?CityID=981. My goal: To redirect all human visitors and search engines looking for the old .aspx pages into the new .php pages. I am thinking that the easiest way to redirect visitors into new pages will be by making a redirect, where all requests for .aspx-files will be redirected into .php filetypes. So, if someone asks for MYSITE/City.aspx?CityID=5, they will be taken into MYSITE/City.php?CityID=5 instead. However, I am having a lot of trouble getting this to work. So far this is what I have found: rewriterule ^([.]+)\.aspx$ http://www.example.com/$1.php [R=301,L] However, I think this can not handle the parameters after the filetype and I am also not quite sure what to put on front. To make things a bit more complicated, at my previous site I used friendly URL's so that I had a huge mapping file with mappings like this: <add url="~/Laajakaista/Ypaja.aspx" mappedUrl="~/City.aspx?CityID=981" /> <add url="~/Laajakaista/Aetsa.aspx" mappedUrl="~/City.aspx?CityID=988" /> <add url="~/Laajakaista/Ahtari.aspx" mappedUrl="~/City.aspx?CityID=989" /> <add url="~/Laajakaista/Aanekoski.aspx" mappedUrl="~/City.aspx?CityID=992" /> I tried to make a simple redirect like this: Redirect 301 Laajakaista/Aanekoski.aspx City.php?CityID=992 but was not able to get it to work. I ended up with an internal server error and a 50k .htaccess-file... Any help is greatly appreciated.

    Read the article

  • How to perform a 301 redirect of all .php URLs to clean URLs?

    - by spacedatdusk
    My htaccess isn't quite working the way I want it to. I've seen some similar threads on here but they aren't quite what I need and I don't know enough yet about htaccess to modify the code to suit my needs. This is what I have working so far: I've got all non-www URLs redirecting to www URLs and I'm doing an internal rewrite of all URLs to the corresponding PHP file on the server. In the files I have relative links that are clean without any file extension on them. This is what I need to do yet: All the pages on my site are still accessible through URLs with .php on the end. For SEO reasons I want the URL's with .php to all do an external 301 redirect to the clean URL without the extension. Here's what I have in my htaccess file that's in the root folder on my server. Options +FollowSymLinks RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME}\.php -f RewriteRule ^(.*)$ $1.php RewriteBase / RewriteCond %{HTTP_HOST} ^domain.com [NC] RewriteRule ^(.*)$ http://www.domain.com/$1 [L,R=301] I'd appreciate any help. Thanks in advance!

    Read the article

  • vHost RewriteRule is creating a 500 Error

    - by Andrew Ellis
    Hello, Below you will find my current vHost entry that I am using for a site that I currently have under development. This vHost entry works fine when I have it on my local machine, but when I push my code to my staging server that is running this same vHost record I receive a 500 Internal Server error. The machine I'm running this vHost on is running Apache 2.2.9 (Debian). <VirtualHost 206.217.196.61:80> SuExecUserGroup 13labs 13labs ServerAdmin [email protected] ServerName admin.13labs.net ServerAlias admin.13labs.net DirectoryIndex index.php DocumentRoot /var/www/13labs.net/html/admin/ ErrorLog /var/www/13labs.net/logs/error.log # Hide .svn Directories <DirectoryMatch "\.svn"> Order deny,allow deny from all </DirectoryMatch> # FastCGI Alias /fcgi-bin/ /var/www/13labs.net/fcgi-bin/ AddHandler php-fastcgi .php AddType application/x-httpd-php .php Action php-fastcgi /fcgi-bin/admin-php.fcgi <Directory /var/www/13labs.net/fcgi-bin/> SetHandler fcgid-script AllowOverride None Options -Indexes +ExecCGI -FollowSymlinks -SymLinksIfOwnerMatch Order allow,deny Allow from all </Directory> <Directory /var/www/13labs.net/html/admin/> AllowOverride None Options -Indexes -FollowSymlinks -SymLinksIfOwnerMatch FileETag All </Directory> # Rewrite Logic RewriteEngine On RewriteCond %{REQUEST_FILENAME} !\.(gif|jpe?g|png|js|css|swf|php|ico|txt|pdf)$ RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-l RewriteRule ^/(.+)$ /index.php/$1 [PT,QSA,L] Thanks for any help that you can provide. Best regards, Andrew

    Read the article

  • mod_rewrite with location-based ACL in apache?

    - by Alexey
    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 ServerName example.com # Global policy is to deny all <Location /> Order deny,allow Deny from all </Location> # doesn't work :( <Location /api/foo> Order deny,allow Deny from all Allow from 127.0.0.1 </Location> RewriteEngine On # The only allowed type of requests: RewriteRule /api/(.+?)/(.+) /cgi-bin/api.cgi?module=$1&func=$2 [PT] # All others are forbidden: RewriteRule /(.*) - [F] RewriteLog /var/log/apache2/rewrite.log RewriteLogLevel 5 ScriptAlias /cgi-bin /var/www/example <Directory /var/www/example> Options -Indexes AddHandler cgi-script .cgi </Directory> </VirtualHost> Well, I know that problem is order of processing that directives. <Location>s will be processed after mod_rewrite has done its work. But I believe there is a way to change it. :) Using of standard Order deny,allow + Allow from <something> directives is preferable because it's commonly used in other places like this. Thank you for your attention. :)

    Read the article

  • PHP: Best solution for links breaking in a mod_rewrite app

    - by psil
    I'm using mod rewrite to redirect all requests targeting non-existent files/directories to index.php?url=* This is surely the most common thing you do with mod_rewrite yet I have a problem: Naturally, if the page url is "mydomain.com/blog/view/1", the browser will look for images, stylesheets and relative links in the "virtual" directory "mydomain.com/blog/view/". Problem 1: Is using the base tag the best solution? I see that none of the PHP frameworks out there use the base tag, though. I'm currently having a regex replace all the relative links to point to the right path before output. Is that "okay"? Problem 2: It is possible that the server doesn't support mod_rewrite. However, all public files like images, stylesheets and the requests collector index.php are located in the directory /myapp/public. Normally mod_rewrite points all request to /public so it seems as if public was actually the root directory too all users. However if there is no mod_rewrite, I then have to point the users to /public from the root directory with a header() call. That means, however that all links are broken again because suddenly all images, etc. have to be called via /public/myimage.jpg Additional info: When there is no mod_rewrite the above request would look like this: mydomain.com/public/index.php/blog/view/1 What would be the best solutions for both problems?

    Read the article

< Previous Page | 42 43 44 45 46 47 48 49 50 51 52 53  | Next Page >