0
votes
0answers
20 views

redirect robots.txt to alternative apache mod rewrite [duplicate]

I'm having trouble trying to get an alternative robots.txt to display for different host names so that Google or Bing won't spider different addresses. Here's what I have so far #temporary dev rule ...
1
vote
2answers
118 views

nginx url rewriting. i just don't get it

Ok, an example url is http://www.mysite.com/?p=account&view=settings the p uri is a constant. all urls have it. the view is one of many optional uri. i've tried to understand url rewriting ...
0
votes
1answer
54 views

Nginx Extract Top Directory Name From Request URI

I am in the need of being able to use top directory from the $request_uri, for example: /dir/sub/slug -> /dir I read the answer of this question: How to extract Only the file name from the request ...
1
vote
0answers
44 views

How to convert RewriteCond rules so they work in Lighttpd?

How can I convert this Apache rewrite rules so they work on Lighttpd? This is in fact a .htaccess file, and I need to put those in a lighttpd.conf file. Options +FollowSymLinks RewriteEngine on ...
0
votes
1answer
376 views

Ngnix Rewrite - If URL contains

I'm having a small issue - my error log is filling up with requests to a directory folder on my site (but with added data that shouldn't be there). http://example.com/the-directory/undefined ...
0
votes
1answer
110 views

NGiNX and MediaWiki rewrite regular expression

I am having some problems with regular-expression with rewrite in NGiNX. Here is my config: location /wiki/ { rewrite ^/([^?]*)/([^?]*)(?:\?(.*))? /$1/index.php?title=$2&$3 last; ...
0
votes
0answers
22 views

Apache 2 rewrite rule expression [duplicate]

I need to make a rewrite rule in an intranet Apache2 (CentOS 6.4) Server. I need to redirect (servername)/(path) to (servername).(domain)/(path) OR (serverIP)/(path) to ...
0
votes
1answer
221 views

nginx rewrite rules with regex applied to one subdirectory only

I've been frustrated for days trying to figure this out, so any advice/help would be greatly appreciated! I've recently added a section called /links to a site at somehost.com but can't seem to get ...
0
votes
0answers
51 views

htaccess Rewrite leading zero in url causing trouble

I have a database with a string column made up of four unique digits attached to each record. I know this isn't the best way to do this but I'm kind of stuck with it. I'm trying to rewrite urls from ...
1
vote
1answer
174 views

nginx + regex, remove all parts of URI except the last one

With an URI like /a-part/some-part/another-part/last-part/?some_param=some_value how do I go about removing everything up to the last part with params and ultimately rewrite it to look like ...
0
votes
1answer
50 views

nginx rewrite and Drupal

My web root is in /staging/ and I'm currently using this rewrite line: location / { # This is cool because no php is touched for static content try_files $uri @rewrite; } ...
0
votes
1answer
123 views

Nginx Config File Regex Issue

I am trying to convert the following rewrite rule into a 'try_files': location ~* \.(css|js) { if (!-f $request_filename) { rewrite ^/wp-content/w3tc/min/(.+\.(css|js))$ ...
2
votes
1answer
1k views

nginx: [emerg] unknown “script_filename” variable

I'm receving this error when trying to use script_filename nginx: [emerg] unknown "script_filename" variable nginx: configuration file /etc/nginx/nginx.conf test failed However script_filename is ...
0
votes
1answer
97 views

Need nginx regex rewrite debuging help [duplicate]

Possible Duplicate: Need custom Nginx regex Desired outcome is this: http://www.example.com/about/?r=something to this: http://www.example.com/about.php/?r=something This is what I ...
1
vote
1answer
501 views

How can I rewrite following url link in nginx?

How can I rewrite following link in nginx? http://www.example.com/filename/key.value/bar.foo to http://www.example.com/filename.php?key=value&bar=foo Notice .php also, please!
1
vote
3answers
227 views

Apache mod_rewrite, multiple variables

I'm struggling a bit with mod_rewrite and replacing multiple variables with regexes. I'm trying to rewrite the following: www.mysite.com/avatars/funny/1 into: ...
0
votes
0answers
106 views

RewriteMap and RewriteRule troubleshooting on Apache2

First off, I'm trying to get the following rule working: RewriteMap legacyredirect txt:/var/www/path/to/legacyredirect.txt RewriteRule ...
4
votes
4answers
2k views

nginx rewrite base url

I would like the root url http://www.example.com to redirect to http://www.example.com/something/else This is because some weird WP plugin always sets a cookie on the base url, which doesn't let ...
0
votes
1answer
1k views

Apache htaccess RewriteRule to remove trailing slash; infinite loop?

I use the following in .htaccess (mod_rewrite) to remove the trailing slash from my URLs: RewriteRule ^([a-z0-9_-]+)/$ $1 [L,NC,R=301] Of course, since the character class doesn't match a slash, ...
1
vote
2answers
140 views

weird apache rewrite regex

I'm in the process of migrating a setup from apache to nginx. In this process I've come across this rewrite rule in an .htaccess file: RewriteRule ^/?(?:(?!one|two|three|four).?)+/?$ ...
0
votes
1answer
47 views

Help with simple mod_rewrite needed

My site uses mod_rewrite for most URL's within the site. eg. domain.com/contact.htm domain.com/product/details.htm I've had domain.com/contact.htm working for a long time and is quite simple, but ...
2
votes
2answers
754 views

nginx rewrite config

I'm pretty new to nginx and am trying to setup some pretty simple rewrite rules, but they don't seem to be working. Just for your info, this server { .. } has its server_name domain.com *.domain.com. ...
4
votes
2answers
225 views

Why does a $1 backreference work in a rewrite with no subgroups?

Someone I'm working with committed a RewriteRule such as the following to SVN: RewriteRule ^admin/ebay.*$ /yii.php/$1 [L] I warned him that it may not work because there is no subgroup in the match ...
2
votes
2answers
719 views

Debugging nginx URL rewrite: How do I figure out where the problem is?

I have a specific URL pattern on a site which needs to be redirected to the HTTPS version. This is a Django site; Nginx checks each URL in memcached, and if it doesn't find a cached version it proxies ...
2
votes
2answers
739 views

nginx 0.7.65 rewrite not working for double slashes?

Using Nginx 0.7.65, I spent a few hours trying to get what seemed to be a simple nginx rewrite to work. But the two forward slashes don't seem to work properly: Url Before: ...
0
votes
1answer
694 views

(Apache) RedirectMatch regex to match all directories except those in my list

I need to 301 redirect all requests coming in for requests to http://server.com to be redirected to http://newserver.com unless the request is for an arbitrary list of directories we are maintaining ...
1
vote
2answers
280 views

mod_rewrite rule

I need a mod_rewrite rule that sends all requests to index.php unless the request is for anything in the /media/ folder. I have a similar rule for lighttpd but I don't know enough about ...
1
vote
1answer
592 views

mod_rewrite rule for images with query string

I'm a mod_rewrite novice and a regex noob, but here's what I want to do: I've got a script that will re-size images on the fly. I'd like to be able to take any image file path, add a query string to ...