Search Results

Search found 3068 results on 123 pages for 'rewrite'.

Page 10/123 | < Previous Page | 6 7 8 9 10 11 12 13 14 15 16 17  | Next Page >

  • Cascade rewriting with special characters

    - by Korjavin Ivan
    I have this .htaccess RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php All queries send to index.php. In my site, I have this link: http://site/search/?v[1]=myid it work nice, I think index.php handle it. But now I want to more readable name for this link, something like http://site.si/byid_$myid.html I tried # RewriteRule ^byid_(.*).html$ search/?v\%5B1\%5D=$1 [NC,PS,NE] #escape and urlencode # RewriteRule ^byid_(.*).html$ search/?v%5B1%5D=$1 [NC,PS,NE] #urlencode # RewriteRule ^byid_(.*).html$ search/?v[1]=$1 [NC,PS,NE] #raw RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php Each of this lines kills rewriting, all requests return 500 error. Where is my fault?

    Read the article

  • Apache 2: Mod_Rewrite Help - If/else for directory exists

    - by BHare
    This is my current and sloppy Apache 2 mod_rewrite. Keep in mine the part with site1 site2..etc has about 50 sites. RewriteEngine on RewriteCond %{HTTP_HOST} ^([^.]+)\.mainsite\.org$ RewriteCond /home/%1/ -d RewriteRule ^(.+) %{HTTP_HOST}$1 RewriteRule ^([^.]+)\.mainsite\.org/media/(.*) /home/$1/special/media/$2 RewriteRule ^([^.]+)\.mainsite\.org/(.*) /home/$1/www/$2 RewriteCond %{HTTP_HOST} ^mainsite\.org$ [NC] RewriteRule ^(.*)$ http://www.mainsite.org$1 [R=302] RewriteCond %{HTTP_HOST} (site1|site2|site3|site4)\.(com|net|biz|org|us)$ [NC] RewriteCond %{REQUEST_URI} !^/media/ RewriteRule ^/(.*)$ /home/%1/www/$1 RewriteCond %{HTTP_HOST} (site1|site2|site3|site4)\.(com|biz|net|org|us)$ [NC] RewriteRule ^/media/(.*)$ /home/%1/special/media/$1 RewriteCond %{REQUEST_URI} favicon.ico$ RewriteRule ^(.*)$ /misc/favicon.ico So if someone tries to go to theirusername.mainsite.org it will check if /home/theirusername/ exists, and if it does use their www (/home/theirusername/www/) as the file location for web files. If they try they try to access theirusername.mainsite.org/media/ it will make a special file location to look for the file(s) at /home/theirusername/special/media/ I would like it if the username did NOT have /home/username that it would automatically default to www.mainsite.org. I am having a hard time understanding how to do skips and such. so: If someone went to notrealusername.mainsite.org/forum/ it would auto direct to www.mainsite.org/forum/ Extra: I am using repetitive code for other site for example lets say foobar has a website foobar.com, it goes through the same process as mainsite.org so figured maybe having something like: RewriteCond %{HTTP_HOST} ^([^.]+).(mainsite.org|com|net|biz|org)$ where I could have one major rule for all existing domains who have a /home/

    Read the article

  • RewriteRule Works With "Match Everything" Pattern But Not Directory Pattern

    - by kgrote
    I'm trying to redirect newsletter URLs from my local server to an Amazon S3 bucket. So I want to redirect from: https://mysite.com/assets/img/newsletter/Jan12_Newsletter.html to: https://s3.amazonaws.com/mybucket/newsletters/legacy/Jan12_Newsletter.html Here's the first part of my rule: RewriteEngine On RewriteBase / # Is it in the newsletters directory RewriteCond %{REQUEST_URI} ^(/assets/img/newsletter/)(.+) [NC] # Is not a 2008-2011 newsletter RewriteCond %{REQUEST_URI} !(.+)(11|10|09|08)_Newsletter.html$ [NC] ## -> RewriteRule to S3 Here <- ## If I use this RewriteRule to point to the new subdirectory on S3 it will NOT redirect: RewriteRule ^(/assets/img/newsletter/)(.+) https://s3.amazonaws.com/mybucket/newsletters/legacy/$2 [R=301,L] However if I use a blanket expression to capture the entire file path it WILL redirect: RewriteRule ^(.*)$ https://s3.amazonaws.com/mybucket/newsletters/legacy/$1 [R=301,L] Why does it only work with a "match everything" expression but not a more specific expression?

    Read the article

  • nginx redirects and rewrites

    - by ptheofan
    I'm closing a website but want to maintain a couple of urls working plus a static html file to serve as index. All old urls should redirect to root (/) except a couple of chosen locations. Here's an example of what I need to do All should give 301 permanent to / http:://www.domain.tld/whatever/anything/realy == 301 ==> http://www.domain.tld http:://www.domain.tld/blabla == 301 ==> http://www.domain.tld http:://www.domain.tld/ == 301 ==> http://www.domain.tld except for http://www.domain.tld/special.html == serve ==> special.html root should serve the defailt file (as specificed in index) http:://www.domain.tld == serve => somefile.html

    Read the article

  • .htaccess rules to rewrite URLs to front end page?

    - by Dizzley
    I am adding a new application to my site at example.com/app. I want views at that URL to always open myapp.php. E.g. example.com/app -> example.com/app/myapp.php and example.com/app/ -> example.com/app/myapp.php What's the correct form of rewrite rules in the .htaccess file? I've got: <IfModule mod_rewrite.c> RewriteEngine On RewriteBase /app/ RewriteRule ^myapp\.php$ - [L] RewriteRule ^myapp.php$ - [L] RewriteRule . - [L] </IfModule> ...based on what the Wordpress front-end does. But all I see at example.com/app is a directory of files. :( (I put those rewrites at the top of my .htaccess file). Any ideas? Update What actually worked: RewriteEngine On RewriteBase / RewriteCond %{REQUEST_URI} ^/app(/.*)?$ [NC] RewriteCond %{REQUEST_FILENAME} !-f RewriteRule . /app/myapp.php [L] This is good because: Explicit or implicit calls to app/myapp.php work. example.com/app redirects to app/myapp.php example.com/app/ redirects to app/myapp.php example.com/app/subfunction redirects to app/myapp.php All other calls to example.com/otherstuff are untouched. Item 4 is Wordpress-like Front Controller pattern behaviour. I think that rule RewriteCond %{REQUEST_URI} ^/app.*$ [NC] needs refining as it allows /app-oh-my-goodness etc. through too. Thanks for the answers.

    Read the article

  • Rewrite img and link paths with htaccess and serve the file from rewritten path?

    - by frequent
    I have a static mockup page, which I want to "customize" by switching a variable used in image-src and link-href attributes. Paths will look like this: <img src="/some/where/VARIABLE/img/1.jpg" alt="" /> <link rel="some" href="/some/where/VARIABLE/stuff/foo.bar" /> I'm setting a cookie with the VARIABLE value on the preceding page and now want to modfiy the paths accordingly by replacing VARIABLE with the cookie value. I'm a htaccess newbie. This is what I have (doesn't work): <IfModule mod_rewrite.c> # get cookie value cookie RewriteCond %{HTTP_COOKIE} client=([^;]*) # rewrite/redirect to correct file RewriteRule ^/VARIABLE/(.+)$ /%1/$1 [L] </IfModule> So I thought my first line gets the cookie value and stores this in %1. And on the second line I'm filtering VARIABLE, replace it with the cookie value and whatever comes after VARIABLE in $1. Thanks for sheeding some light on what I'm doing, doing wrong and if I can do this at all using htaccess. EDIT: I'm sort of halfway through, but it's still not working... Mabye someone can apply the finishing touches: <IfModule mod_rewrite.c> # check for client cookie RewriteCond %{HTTP_COOKIE} (?:^|;\s*)client=([^;]*) # check if an image was requested RewriteCond %{REQUEST_FILENAME} \.(jpe?g|gif|bmp|png)$ # exclude these folders RewriteCond %{REQUEST_URI} !some/members/logos # grab everything before the variable folder and everything afterwards # replace this with first bracket/cookie_value/second bracket RewriteRule (^.+)/VARIABLE/(.+)$ $1/%1/$2 [L] </IfModule> Still can't get it to work, but I think this is the correct way of doing it. Thanks for help!

    Read the article

  • Apache rewrite rules redux

    - by AlexanderJohannesen
    I've got a REST framework that when plopped into any directory should Just Work(TM), and it seems to work fine when I've got projects in subdirectories, but not if it's in root. So, given a few example directories; / /project1 /bingo/project2 /hoopla/doopla/minor/project3 All of these works fine, except I'm getting "funnies"* when the project runs in the root directory (bit hard to explain, I suppose, but the second level rewrites are not working properly). Here's my attempt at a generic .htaccess file: RewriteEngine On RewriteRule ^static/ - [L] RewriteCond %{REQUEST_URI} ^$ RewriteRule .* ./ [R,L] RewriteRule ^index.php - [L] RewriteRule (.*) index.php?q=$1 [QSA,PT] (And yes, all projects have a subdirectory ./static which is ignored by rewrites) What I'm trying to achieve is a set of rewrite rules that work for most cases (which is, again, plonking the project in a directory the webserver serves). I'm not a rewrite rules wiz by a long shot, and any good advice and gotchas would be appreciated (and yes, I've gone through too many introductory articles. I need some serious juice.) More info on the funnies; my webserver has docroot in one spot (under /usr/share/apache2/default-site/), but a set of rules that says that /projects is pulled in from somewhere else that's not a subdirectory of docroot (/home/user/Projects/). When I go there, I get a list of /projects subdirectories, and if one of those subdirectories gets called (restmapp) with the proposed rewrite rules, I get ; The requested URL /home/user/Projects/restmapp/index.php was not found on this server.

    Read the article

  • Nested URLs and Rewrite rules in Apache2

    - by Radha Krishna. S.
    Hi, I need some help with rewrite rules and nested URLs. I am using TikiWiki for my website and am in the process of setting up SE friendly URLs for my projects. Specifically, I have the following rewrite rule for www.example.com/projects to point to a page that lists out all the projects hosted in example. RewriteRule ^Projects$ articles?type=Project [L] This works fine. Now, I would like to point www.example.com/projects/project1 to point to a specific project. I have this rewrite rule RewriteRule ^(Projects/Project1)$ tiki-read_article.php?articleId=6 This works, but partially. The content is all rendered as text but the theme - images/ css etc all go for a toss - the page is completely in text. I understand that this happens 'cause the relative paths in the theme/ css/ images all refer to Projects as the base folder instead of the root of the website. I don't want to touch the CMS portion - change the theme/ css/ image paths in the files, more for reasons of upgradability. Can someone help me understand and write a rule so that the above nested URL works? Regards, Radha

    Read the article

  • Exclude a directory from a rewriterule using ISAPI rewrite 3

    - by mludd
    Basically I've recently added the below rule in my httpd.conf for ISAPI rewrite on an IIS server to make sure that it always defaults to lower-case file and directory names. RewriteRule ^(.*[A-Z].*)$ $1 [CL,R=301,L] This is all fine and dandy for every part of the site except for one directory which we can call /MisbehavingDir, the code in this particular directory is filled with mixed-case filenames and lots of server- and client-side scripting that would have to be rewritten to use all lower-case in order to work properly (with the RewriteRule above it seems to hit a couple of 301s in the wrong places which causes that part of the site to function poorly to say the least). Since I'm not in the mood for rewriting that part of the site I'd love to find a good way to modify the above regex so that it matches everything except paths starting with MisbehavingDir and since my regex-fu isn't really good enough I figured I'd ask here. Is there a simple "beautiful" solution to this that anyone wants to share or should I just set aside several days to rewrite the app, then test it and go through that whole dance?

    Read the article

  • Problem in apache2 with mod rewrite when setting rules in .conf files instead of .htaccess

    - by gonzlikes
    Hi, Because of weird security policies of my hosting provider I have to define my rewrite rules in /etc/apache2/conf.d/examplesite.conf instead of writing them on an .htaccess on the www folder of that site. What I'm trying to do is setup a Wordpress Mu server (http://mu.wordpress.org/forums/topic/17349 ) and so far its working on a 50%. The main blog loads perfectly but other sub blogs (located for example at www.example.com/blog2 ) don't. I'm guessing the problem is that the rewrite rules behave differently when declared at .conf files for each virtual host instead of using .htaccess files. Has anybody else had this problem? How can you fix it?

    Read the article

  • IIS7 URL Rewrite with dynamic subdomains.

    - by arri.me
    My goal is to implement the following scheme using the subdomain and path as attributes: Use a wildcard DNS entry that routes any subdomain to the root site: Example: *.example.com ex: http://xyz.example.com to http://example.com Next I want to rewrite the requests to point to a specific page, passing both the subdomain and the request path as attributes. Example: http://xyz123.example.com/images/header.jpg to http://example.com/get.aspx?id=xyz123&path=/images/header.jpg I've seen several questions on here regarding similar goals, but not quite the same. I'm new to using rewrite rules, so any help is appreciated. I will update this as I make progress.

    Read the article

  • htaccess mod rewrite changes http://www to http:/www

    - by Nir
    I want to replace calls like this: www.mysite.com/sub/file.php?param1=x&param2=http://www.someurl.com with: www.mysite.com/sub/param1/param2 Param 1 is an integer number Param 2 is a url I wrote this rewrite rule in htaccess: RewriteCond %{REQUEST_URI} \/sub\/ RewriteRule sub\/([0-9]+)\/(.*)$ sub\/file.php?param1=$2&param2=$1 [L] Unfortunately param2 (the URL) starts with http:/www.someurl.com instead of http://www.someurl.com (note the single slash). Any idea what causes it? When I call the same file with same parameters in the format www.mysite.com/sub/file.php?param1=x&param2=http://www.someurl.com , param2 does appear OK so it must be something with the rewrite rule.

    Read the article

  • Chained address rewrite

    - by kemp
    What I need to do is rewriting this address: (1) http://localhost/wordpress/fake/text-value to (2) http://localhost/wordpress/gallery?somevar=text-value Notes: the remapping must be transparent: the user always has to see address (1) gallery is a permalink to a wordpress page, not a real address I basically need to rewrite the address first (to modify it) and then feed it back to mod rewrite again (to let wordpress parse it its own way). Problems if I simply do RewriteRule ^fake$ http://localhost/wordpress/gallery [L] it works but the address in the browser changes, which is no good, if I do RewriteRule ^fake$ /wordpress/gallery [L] I get a 404. I tried different flags instead of [L] but to no avail. How can I get this to work?

    Read the article

  • Wordpress rewrite image path

    - by Brad
    I've got a website that is running WordPress. It has several pictures that I am retrieving from a datafeed. The images from the datafeed are at locations like: http://image4.example.com/640/examples/example.jpg http://image4.example.com/640/example.jpg The image4 and 640 locations can change. I want to rewrite the images to where they show as from my website. I've tried: rewritecond %{HTTP_HOST} !^image4.example.com$ rewriterule ^([^/]+)$ http://image4.mywebsite.com/$1 [L,R=301] but it doesn't work. I don't know much about Mod Rewrite. any help would be appreciated, and no I'm not hijacking the images, i have permission to use them and the bandwidth. Thanks -Brad

    Read the article

  • Chained address rewrite in Wordpress

    - by kemp
    What I need to do is rewriting this address: (1) http://localhost/wordpress/fake/text-value to (2) http://localhost/wordpress/gallery?somevar=text-value Notes: the remapping must be transparent: the user always has to see address (1) gallery is a permalink to a wordpress page, not a real address I basically need to rewrite the address first (to modify it) and then feed it back to mod rewrite again (to let wordpress parse it its own way). Problems if I simply do RewriteRule ^fake$ http://localhost/wordpress/gallery [L] it works but the address in the browser changes, which is no good, if I do RewriteRule ^fake$ /wordpress/gallery [L] I get a 404. I tried different flags instead of [L] but to no avail. How can I get this to work?

    Read the article

  • Redirect in combination with a rewrite condition in htaccess

    - by Robbert van den Bogerd
    Hi all! I've got a cms-driven website, with no option to change the code. What I want to accomplish is creating friendly url's, using only apaches mod-rewrite engine. The problem is I'm creating an infinite loop, because I first redirect the original url (index.php?id=21) to a friendly one (/friendly/) and then rewrite the '/friendly' part back to 'id=21' I know there should be an extra condition or parameter to avoid looping in this case, but I can´t get one of the possible solutions to work. Here´s the code: RewriteCond %{query_string} ^id=21$ [NC] RewriteRule /* /peuterspeelzaal? [R=301,L] RewriteRule ^peuterspeelzaal$ index.php?id=21 [L]

    Read the article

  • Apache mod-rewrite for shorter urls

    - by Don
    Is it possible do do something like this with mod-rewrite? Current url: www.example.com/Departments/dynamicPage.php?DeptID=10&DeptName=HR to set up a rewrite so: www.example.com/hr could redirect to the above (with the arguments)? I know I could create an "hr" folder on the root level and put in an html page with a meta refresh, but I hate the extra clutter. I don't think a .htaccess 301 is possible, but please correct me if I'm wrong. I'm looking for an elegant solution that can be added to for future instances.

    Read the article

  • Apache and Rewrite Module

    - by Yvon Blais
    I created a file .htaccess in the /var/www directory., The rights are root root --wxrwxrwxr The content of the file is : Options +FollowSymlinks RewriteEngine on RewriteLogLevel 3 RewriteLog "/var/log/apache2/rewrite.log" RewriteRule ^(.*?)$ testphp.php When I call the page phpinfo.php, I've got: Loaded Modules ... mod_rewrite ... Therefore, the modules is loaded Afer each modification,I restared the server manually with sudo /etc/init.d/apache2 restart The error.log gives Apache/2.2.14 (Ubuntu) PHP/5.3.2-1ubuntu4.2 with Suhosin-Patch configured -- resuming normal operations When I call a page anyone.htm or anyone.php, the rewrite.log does contain nothing and the real page is called. If I understand, the page anyone.php should be replaced by testphp.php Did I make siomething wrong ? Thanks

    Read the article

  • YUI Compressor + gzip causes Illegal Character error in jQuery

    - by lo_fye
    When I minify jquery using YUI compressor, it works fine. When I then add gzip compression (and serve this version via mod rewrite), the gzipped version throws this error: illegal character in jquery.min.js on line 1 Line 1 is: ???????M???????????s?8?0???!sz?dKr?=? This results in a "jquery is not defined" error. I am using the following rewrite rules to serve up the gzipped versions: #Check to see if browser can accept gzip files. ReWriteCond %{HTTP:accept-encoding} (gzip.*) #make sure there's no trailing .gz on the url ReWriteCond %{REQUEST_FILENAME} !^.+\.gz$ #check to see if a .gz version of the file exists. RewriteCond %{REQUEST_FILENAME}.gz -f #All conditions met so add .gz to URL filename (invisibly) RewriteRule ^(.+) $1.gz [L] I can't find any references to this happening to anyone else. Thoughts?

    Read the article

  • Lighttpd rewriting files and directories

    - by Ronald
    I'm trying to do url rewriting with Lighttpd. I have what I need partially working. Right now I have this: http://domain.com/name/a/123 which rewrites to http://domain.com/name/a.php?pid=123 I do this with this rewrite-once rule: "^/name/a/([^/]+)"= "/name/a.php?pid=$1" That php page has external resources that are not getting rewritten such as the JavaScript and CSS files. Is there a way I can also have the rewrite do the following? http://domain.com/name/a/js/file.js = http://domain.com/name/js/file.js

    Read the article

  • SEO made easy with IIS URL Rewrite 2.0 SEO templates

    A few weeks ago my team released the version 2.0 of the URL Rewrite for IIS. URL Rewrite is probably the most powerful Rewrite engine for Web Applications. It gives you many features including Inbound Rewriting (ie. Rewrite the URL, Redirect to another URL, Abort Requests, use of Maps, and more), and in Version 2.0 it also includes Outbound Rewriting so that you can rewrite URLs or any markup as the content is being sent back even if its generated using PHP, ASP.NET or any other technology. It also...Did you know that DotNetSlackers also publishes .net articles written by top known .net Authors? We already have over 80 articles in several categories including Silverlight. Take a look: here.

    Read the article

  • Why isn't this rewrite rule (nginx) applied? (trying to setup Wordpress multisite)

    - by Brian Park
    Hi, I'm trying to setup Wordpress multisite (subfolder structure) with nginx, but having a problem with this rewrite rule. Below is the Apache's .htaccess, which I have to translate into nginx configuration. RewriteEngine On RewriteBase /blogs/ RewriteRule ^index\.php$ - [L] # uploaded files RewriteRule ^([_0-9a-zA-Z-]+/)?files/(.+) wp-includes/ms-files.php?file=$2 [L] # add a trailing slash to /wp-admin RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ $1wp-admin/ [R=301,L] RewriteCond %{REQUEST_FILENAME} -f [OR] RewriteCond %{REQUEST_FILENAME} -d RewriteRule ^ - [L] RewriteRule ^([_0-9a-zA-Z-]+/)?(wp-(content|admin|includes).*) $2 [L] RewriteRule ^([_0-9a-zA-Z-]+/)?(.*\.php)$ $2 [L] RewriteRule . index.php [L] Below is what I came up with: server { listen 80; server_name example.com; server_name_in_redirect off; expires 1d; access_log /srv/www/example.com/logs/access.log; error_log /srv/www/example.com/logs/error.log; root /srv/www/example.com/public; index index.html; try_files $uri $uri/ /index.html; # rewriting uploaded files rewrite ^/blogs/(.+/)?files/(.+) /blogs/wp-includes/ms-files.php?file=$2 last; # add a trailing slash to /wp-admin rewrite ^/blogs/(.+/)?wp-admin$ /blogs/$1wp-admin/ permanent; if (!-e $request_filename) { rewrite ^/blogs/(.+/)?(wp-(content|admin|includes).*) /blogs/$2 last; rewrite ^/blogs/(.+/)?(.*\.php)$ /blogs/$2 last; } location /blogs/ { index index.php; #try_files $uri $uri/ /blogs/index.php?q=$uri&$args; } location ~ \.php$ { include /etc/nginx/fastcgi_params; fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME /srv/www/example.com/public$fastcgi_script_name; } # static assets location ~* ^.+\.(manifest)$ { access_log /srv/www/example.com/logs/static.log; } location ~* ^.+\.(ico|ogg|ogv|svg|svgz|eot|otf|woff|mp4|ttf|css|rss|atom|js|jpg|jpeg|gif|png|ico|zip|tgz|gz|rar|bz2|doc|xls|exe|ppt|tar|mid|midi|wav|bmp|rtf)$ { # only set expires max IFF the file is a static file and exists if (-f $request_filename) { expires max; access_log /srv/www/example.com/logs/static.log; } } } In the above code, I believe rewrite ^/blogs/(.+/)?(.*\.php)$ /blogs/$2 last; has no effect because when I look at the access_log file, I see the following line: 2010/09/15 01:14:55 [error] 10166#0: *8 "/srv/www/example.com/public/blogs/test/index.php" is not found (2: No such file or directory), request: "GET /blogs/test/ HTTP/1.1" (Here, 'test' is the second blog created using multisite feature) What I'm expecting is that /blogs/test/index.php gets rewritten to /blogs/index.php, but it doesn't seem to do that... Am I overlooking something obvious? Thanks!

    Read the article

  • Maintaining ISAPI Rewrite Path with the ASP.NET tilde (~)

    - by Adam
    My team is upgrading from ASP.NET 3.5 to ASP.NET 4.0. We are currently using Helicon ISAPI Rewrite to map http://localhost/<account-name>/default.aspx to http://localhost/<virtual-directory>/default.aspx?AccountName=<account-name> where <account-name> is a query string variable and <virtual-directory> is a virtual directory (naturally). Before the upgrade the tilde (~) resolved to http://localhost/<account-name>/... (which I want it to do) and after the upgrade the tilde resolves to http://localhost/<virtual-directory>/... which results in an error because the <account-name> query string is required. I'd like to avoid going down the road of replacing everything with relative paths because there are several features in our system that use the entire URL instead of just the relative path. For what it's worth I'm using IIS7 in Windows 7, Visual Studio 2010 with ASP.NET 4.0 and the 64 bit Helicon ISAPI Rewrite. If I switch back to the ASP.NET 3.5 version then it still works fine (leading me to believe nothing changed in IIS unless it's within the 4.0 app pool - when I switch back and forth between 3.5 and 4.0 I have to change the app pool in IIS). Any ideas? Thanks in advance!

    Read the article

  • using mod-rewrite to redirect requests for jquery.js to GoogleAPI cache

    - by Aditya Advani
    Hi All, Our Linux server with Apache 2.x, Plesk 8.x hosts a number of e-commerce websites. To take advantage of browser caching we would like to use Google's provided copy of jquery.js. Hence in the vhost.conf file of each we can use the following RewriteRule RewriteCond %{REQUEST_FILENAME} jquery.min.js [nc] RewriteRule . http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js [L] And in vhost_ssl.conf RewriteCond %{REQUEST_FILENAME} jquery.min.js [nc] RewriteRule . https://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js [L] OK now these rules work fine in the individual vhost.conf files of each domain. However we host over 200 domains, I would like for them to work but cannot seem to get them to work globally in the httpd.conf file. Challenges are the following: Get the rewriterule to work in httpd.conf Detect if HTTPS is on, and if it is and the is is a secure page, rewrite to ... Each individual domain will still have it's own custom mod-rewrite rules. Which rules take precedence - global or per-domain? Do they combine? Is it ok if I have the "RewriteEngine On" directive in the global httpd.conf and then again in the vhost.conf? Please let me know what your guys' suggestions are. Desperate for a solution to this problem.

    Read the article

  • Cookie not working after mod rewrite rule

    - by moonwalker
    Hi all, I have a simple Cookie to set the chosen language: $lang = $_GET['lang']; $myLang = $_COOKIE["myLang"]; if (!isset($_COOKIE["myLang"])){ setcookie("myLang", "en", $expire); include "languages/en.php"; $myLang = "en"; }else{ include "languages/$myLang.php"; } // One year to expire $expire = time()+60*60*24*30*365; // Put $languages in a common header file. $languages = array('en' => 1, 'fr' => 2, 'nl' => 3); if (array_key_exists($lang, $languages)) { include "languages/{$lang}.php"; setcookie("myLang", $lang, $expire); $myLang = $lang; } After using some rewrite rules, it just doesn't work anymore. I tried the following: setcookie("myLang", "en", $expire, "/" , false); No luck at all. This is my .htaccess file: <IfModule mod_rewrite.c> Options +FollowSymLinks Options +Indexes RewriteEngine On RewriteBase / RewriteRule ^sort/([^/]*)/([^/]*)$ /3arsi2/sort.php?mode=$1&cat=$2 [L] RewriteRule ^category/([^/]*)$ /3arsi2/category.php?cat=$1 [L] RewriteRule ^category/([^/]*)/([^/]*)$ /3arsi2/category.php?cat=$1&lang=$2 [L] RewriteRule ^search/([^/]*)$ /3arsi2/search.php?mode=$1 [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^u/([^/]+)/?$ 3arsi2/user.php?user=$1 [NC,L] RewriteRule ^u/([^/]+)/(images|videos|music)/?$ 3arsi2/user.php?user=$1&page=$2 [NC,L] RewriteRule ^([^\.]+)$ 3arsi2/$1.php [NC,L] </IfModule> Any idea how to solve this? I'm still new to the mod rewrite thing, so I still don't really understand the logic behind it all. Thanks for any help you can provide.

    Read the article

< Previous Page | 6 7 8 9 10 11 12 13 14 15 16 17  | Next Page >