All Questions
179 questions
0
votes
0
answers
25
views
Laravel RewriteRule on htaccess with "at sign" @ for profile names on URL
I am trying to create a rewrite rule on a Laravel project route; the most straightforward approach should be like this:
RewriteEngine On RewriteRule ^@([^/]+)$ /someurl/$1
However, trying this on a ...
0
votes
0
answers
31
views
Using mod_rewrite to simplify and shorten URL parameter [duplicate]
I'm trying to get the following URL: https://example.com/database?serial_number=XYZ
Turned into https://example.com/database/XYZ
So far everything I have tried either didn't work, created redirect ...
1
vote
1
answer
79
views
.htaccess redirect based on folder
I need help with .htaccess Rewrite rules.
I have a API which can be accessed over http://api.my.domain/products/all which is working fine and is returning result.
I would like to redirect users coming ...
2
votes
1
answer
533
views
Convert Apache rewrite rules (front-controller) to Nginx
I need a small hand fixing rewrite rules for Nginx.
Folder structure is like this:
dev.example.com/public_html << contain the site
<IfModule mod_rewrite.c>
Options -Multiviews
...
0
votes
1
answer
246
views
Conversion of Nginx to Apache Rewrite Rule
I'm having to move nginx sites over to apache and I'm having an issue w/ mod rewrite rules. These are my nginx rewrite rules and I'm not... quite... nailing it as I've tried various iterations on my ....
0
votes
2
answers
773
views
How to configure .htaccess for a Laravel API app which is hosted on a subdomain?
I have a domain mydomain.com and a nginx space to host my website. The URL address mydomain.com is already in use and I don't want to buy another domain, so I created a subdomain myapp.mydomain.com. ...
2
votes
1
answer
577
views
URL with Rewrite in Nginx
I want the URLs to look clean and nice with rewrite. I was able to do this while using Apache, but I installed Nginx on the server. So I don't use .htaccess.
While using Apache, I was using it like ...
1
vote
2
answers
113
views
How to convert htaccess to nginx
I have problems to convert a htaccess file to nginx. Maybe someone can help me.
I need the following code converted:
Options +FollowSymLinks -MultiViews
RewriteEngine On
RewriteBase /
RewriteCond %{...
1
vote
1
answer
2k
views
Rewrite URL to index.php using nginx server
I need a help to configure my website on nginx server. Earlier i was using apache so there i was using htaccess to redirect on index.php. But i just got to know that nginx don't support htaccess. I am ...
1
vote
1
answer
76
views
migrate htaccess rewrite to nginx
I have the followinf rewrite rule on htaccess:
RewriteEngine on
RewriteCond %{THE_REQUEST} /([^?]+?)(?:\.php)?\?lang=([^\s&]+) [NC]
RewriteRule ^ /%2/%1? [R=301,L,NE]
The rule redirects "...
0
votes
1
answer
39
views
.htaccess dash in argument
I have the following htaccess rule:
RewriteRule ^listen/([^/]*)-([^/]*)/$ listen.php?pl=$1&id=$2
Sometimes the second argument (id) has a dash in it and I get 404 Not found, e.g:
mysite.com/...
0
votes
0
answers
39
views
Translate Nginx rewrite rule to Apache
Help with changing code in Nginx, I would like to pass it to .htaccess, is that possible?
location ~ ^/api/(?:tickets|tasks|auth).*$ {
try_files $uri $uri/ /api/http.php?$query_string;
}
0
votes
1
answer
38
views
Redirection subdomain
I was trying now for hours to get it working but without a solution.
RewriteCond %{HTTPS} !=on
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301,NE]
RewriteCond %{HTTP_HOST} ^forum\....
1
vote
1
answer
282
views
Limit amount of parameters in query string
I just want to limit the amount of parameters that nginx/apache allows to pass. For example: if someone tries to access a link like test.php?arg1=value&arg2=value&arg3=value give them a 404 ...
1
vote
1
answer
1k
views
Nginx URL rewrite to remove folder from URL when its followed by certain subfolders
After I have upgraded my site I see that once I go live with new version some parts of the website URLs will not be redirected for gallery, blogs and files because of new structure. And there is no ...
0
votes
0
answers
103
views
SSL rewrite and URL rewrite for .htaccess
I have two criteria I am trying to meet with my .htaccess file and I'm currently getting an infinite redirect loop. I need to:
Ensure SSL (https) when visitors attempt to resolve to the http version ...
1
vote
1
answer
87
views
How does one write positional parameters followed by a digit in a rewrite rule in an nginx.conf file?
I've encountered an nginx.conf file that includes a rewrite rule:
rewrite "^(.*/)?8.0/shcb[0-9]+/resources/(.*)" "$18.0/resources/$2";
I'm thinking that $18 is an error. But, I'm not sure if this is ...
0
votes
1
answer
158
views
Redirect all urls with parameters from old domain to new except one url
In order to redirect all requests from old domain https://old4.old3.old2.ua to new domain https://new4.new3.new2.ua I implemented the following rules in .htaccess:
RewriteEngine ON
RewriteRule ^(.*)$ ...
0
votes
1
answer
267
views
HTACCESS Rewrite Rule Results in a Redirect Loop
I've set up Apache behind NGINX proxy and my HTTPS redirect (rewrite) rule results in a redirect loop. It looks like HTTPS is returned as false despite I'm setting the environmental variable properly.
...
2
votes
1
answer
1k
views
How can we redirect to new HTML static content with Apache and fall back to older CMS-based PHP version if not found? (nginx try_files)
The Problem :
We are in the process of replacing an old PHP-based web site (based on Statamic v1) with a SSG HTML version build with Gatsby.
The problem is : only a part of the existing pages must ...
0
votes
2
answers
50
views
.htaccess - any query to index.php - problems with nginx
I thought that i have only apache on my server, but i see that nginx catches some query's before apache do...
my .htaccess file:
RewriteEngine On
RewriteRule ^.*$ index.php [NC,L]
But when i go to ...
0
votes
1
answer
170
views
Rewrite rule for images using .htaccess or nginx config
we need to set rewrite rule for some images using .htaccess rules or nginx conf
Example 1
Request Path:
https://www.example.com//media/catalog/product/cache/1/thumbnail/543x403/...
0
votes
1
answer
58
views
mod rewrite from apache to nginx
I'm having some trouble in transformation of htaccess from apache to nginx.
actual htaccess rule:
options +followsymlinks
RewriteEngine On
RewriteCond $1 !^(images|system|themes|css|js|flex|slider|...
1
vote
1
answer
27
views
Migration failed from htaccess to nginx configuration
I'm in process of migration from .htaccess to nginx.conf file but after migration rules doesn't work as I expected.
This is content of .htaccess that I'm gonna migrato to nginx.
DirectoryIndex index....
0
votes
1
answer
163
views
htaccess config for urls
I'm migrating a website from an old server and after I uploaded all the files and connect the database, the dynamic content on pages is giving me a 404 error.
The old server was managed with Nginx, ...
1
vote
1
answer
84
views
Rewrite directory location to a php file nginx
I'm having difficulty converting this .htaccess in /thumb directory to nginx to work.
.htaccess file:
Options +FollowSymLinks
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule .* .....
3
votes
1
answer
1k
views
.htaccess doesn't escape question mark on RewriteRule
I have a website with an old type of Single Sign On. A parent website sends users to my website with a URL like:
http://blabla.test/index.php?gid=abcd1234&u=bcanata&id=11472
and I want to ...
0
votes
1
answer
31
views
convert rules from htaccess to nginx
hope somebody can help me, in transforming my apache htaccess rules to nginx config
Removing the .php from the url's, so url: "/contac"t displays the file contact.php
Make this paths use their ...
0
votes
0
answers
232
views
nginx pretty url's smf unknown directive
I have a problem with nginx to see if a user can help me, I can not activate pretty url in my forum smf
Restarting nginx: nginx: [emerg] unknown directive "action=$1" in /etc/nginx/sites-enabled/...
0
votes
1
answer
690
views
Solving the WordPress permalink issue on a virtual server
I have a variation on the old WordPress problem regarding permalinks failing (404 errors) when permalinks are set to anything other than 'plain' (where plain = http://example.com/?p=123 and a 'pretty' ...
1
vote
1
answer
267
views
nginx and htaccess rewrite rule with optional parameters
I'm trying to make a rewrite rule in NGINX and .htaccess. Now, I have a link http://project2.local/recordings which can be accessed like that, but it has an optional parameter camera. So you can ...
0
votes
0
answers
119
views
converting apache rewrite to nginx url rewrite
can anybody help me to convert .htacess file to nginx rewrite rule
my htaccess blew
RewriteEngine On
RewriteRule ^video/([^/]*)/([^/]*)\/$ /index.php?page=details&title=$1&id=$2 [L]
...
3
votes
1
answer
5k
views
Laravel - NGINX + Apache reverse proxy 404 on all routes
i'm setting up a project in Laravel which makes use of a custom vagrant box based on Ubuntu 14.04 and which runs NGINX and Apache in a typical reverse proxy setup.
Now, the issue is that something ...
1
vote
1
answer
4k
views
Nginx Equivalent of Apache .htaccess
I've installed a PHP web application using a LEMP stack and I need to port some Apache .htaccess rewrite rules to the Nginx equivalents.
.htaccess
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-...
0
votes
1
answer
563
views
Nginx redirect and preserve url
I would like to redirect all urls to the directory root on a server running Nginx, while preserving the original path in the url.
For example: domain.com/test redirects to domain.com/ and its index ...
0
votes
0
answers
45
views
Htaccess apache permalink 404 (they dont work anymore)
we switched a website from nginx to normal apache webserver but now we have a big problem with the permalinks: all dropping 404. (before everything worked great)
I tried to configure the htaccess file ...
2
votes
1
answer
2k
views
Convert nginx to lighttpd rewrite rule
I need to change nginx server to lighttpd server. The CMS should be run on a web server that supports URL rewriting. Working nginx config is provided below. The problem is to covert nginx ...
1
vote
0
answers
4k
views
Rewrite htaccess to nginx with http authorization
I have a apache2 rewrite rule in .htaccess:
RewriteRule ^down.pl down.pl [E=HTTP_AUTHORIZATION:%{HTTP:AUTHORIZATION},L,QSA]
Please, how to rewrite it for nginx?
My nginx code looks like:
setenv ...
0
votes
0
answers
148
views
Apache htaccess to NGINX
I'm trying to understand how NGINX url rewrite is different from Apaches url rewrite, So here what i've tried
Fomr my .htaccess file
RewriteEngine on
RewriteRule ^(index|login|logout|404)/?$ $1.php ...
1
vote
1
answer
365
views
Rewrite URLs with Nginx
I am running on Nginx and I am trying to create a blog that essentially works like this:
I create a new post with the title "How to Create a New Website" under the "business" category
I turn that ...
0
votes
1
answer
65
views
.htaccess Rewrite Conditions to nginx config - multiple conditions & rewrite
I have the following rewrites in .htaccess:
#exception for shorthand phpthumb links eg /userfiles/myimage.jpg?w=300
RewriteCond %{REQUEST_URI} \.(jpg|jpeg|png|gif|bmp|JPG|)$
RewriteCond %{...
0
votes
1
answer
502
views
ERR_TOO_MANY_REDIRECTS htaccess
Could anyone can explain me what this .htaccess code doing?
RewriteRule ([0-9]+)/([^t]{1}[A-Za-z0-9_-]{0,})\.([^s]{1}[A-Za-z0-9]+)$ ../items/go.php?u=$1/$2.$3
I have a folder : mywebsite.com/...
0
votes
0
answers
43
views
Why NGINX rewrite rule does'nt working in online server but it is working in offline?
So here is the rewrite rule I made in website.conf
it is working in offline server. but when I put it inline it doesn't work it produced 404 not found. Our server is nginx/1.8.0
location / {
...
1
vote
1
answer
708
views
Problems moving Sites from Apache to Nginx (mod_rewrite)
I am migrating some vhosts from apache to nginx. Unfortunately i am having some troubles because of .htaccess files from the apache instance.
Here is the situation (apache):
The DocumentRoot has ...
0
votes
1
answer
88
views
nginx rewrite to htaccess rewrite
How to make Basic Auth exclude a rewritten file?
location ~ "^/blank.gif" {
auth_basic off;
}
location / {
auth_basic "Restricted Content";
auth_basic_user_file /etc/nginx/.htpasswd;
}...
0
votes
2
answers
203
views
How to convert this apache rewrite rule to nginx
I've been struggling to convert my past apache rewrite rule to nginx (also not sure if I'm placing it in the right place so would appreciate if you can tell me where to place it).
Basically this was ...
1
vote
1
answer
1k
views
htaccess rewrite to nginx config not working
I'm having a problem converting an appache .htaccess file work with nginx.
The .htaccess file
<ifModule mod_rewrite.c>
Allow from 127.0.0.1
RewriteEngine On
RewriteCond %{...
1
vote
1
answer
385
views
Convert .htaccess rule to nginx
I'm trying to move a site that was born on apache server to a nginx server.
I've the current .htaccess:
RewriteEngine on
RewriteRule ^(Personal)($|/) - [L]
RewriteRule ^mng/([-0-9a-zA-Z/%&]+)$ /...
2
votes
1
answer
690
views
Apache mod_rewrite to Nginx
Not sure how to change this to nginx mod_rewrite, tried http://winginx.com/en/htaccess but no success.
Apache rewrite is :
<IfModule mod_rewrite.c>
<IfModule mod_negotiation.c>
...
1
vote
1
answer
51
views
Nginx : Exclude specific Name based Redirection rule
I have redirection rule in place on nginx config like,
location ~ ^/abc/(.*) {
rewrite ^www.abc.com/web/primary/abc.html/$1;
}
but I need to exclude few directories of my redirection location for ...