Tagged Questions
0
votes
0answers
17 views
Correct rewrite rules from Apache to Nginx? [closed]
I'm having quite a difficult time translating some .htaccess rules to Nginx. My .htaccess codes are:
RewriteEngine on
Options -Indexes
RewriteCond %{HTTP_HOST} !^www\.(.*)$ [NC]
RewriteRule ^(.*)$ ...
0
votes
1answer
24 views
htaccess subdomain Redirect issue
I am trying to build a wordpress site with mobile. I have set the sub-domain in httpd.conf and htaccess.
now i add some custom search in a e:\wp\custom\ folder, another mobile custom search in ...
0
votes
2answers
43 views
.htaccess - complicated conditions
I've been trying to wrap my head around .htaccess for most of the weekend, but I keep stumbling; I can get the server to work with one set of rules, but no more than one at a time.
My application is ...
-1
votes
0answers
13 views
Rewrite Rule for long page [duplicate]
does anyone can provide me the Rewrite Rule HTACCESS
to redirect user who access
www.domain.com/a/b/c/d/e (unlimited slash)
to www.domain.com/search.php?q=e (where e point to last page)
thanks
0
votes
1answer
35 views
Converting .htaccess to nginx
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*) p.php?id=$1 [L,QSA]
How would I change that to work with nginx?
Also, where do I place ...
1
vote
2answers
54 views
Using several rewrite rules .htaccess
I have a website wich is based on a searchpage, which shows a list, and next is a detail page of the items.
if visitors use rootdomain.com/searchterm, should be redirected to ...
0
votes
1answer
40 views
How can I use Apache RewriteRules + PHP to determine which page to show?
I am trying to make a scalable RewriteRule on my .htaccess, I use each word before slash as a parameter.
for example: http://localhost/mysite/param1/param2/param3/.../param20
I am working with this ...
0
votes
1answer
91 views
htaccess rewriterules for multiple pages with parameters
In main page index.php I have two href (like menu) for objective.php and news.php
For both objectives and news I sent variables like:
<a href="objectives.php?menu=corporate-objectives">
...
1
vote
1answer
57 views
Redirect HTTPS to HTTP
The problem: I cannot get my site to redirect from https to http.
OK, there are a number of solutions offered on this but none seem to be working for me. To establish a few things, I already have ...
0
votes
1answer
54 views
htaccess rewrite to remove url from path
Due to a previously misconfigured rewrite rule I have a whole lot of errors listed in webmaster tools like the following:-
http://www.domain.com/www.domain.com/page.html
...
0
votes
1answer
38 views
Fixing mod_rewrite rule in Apache to apply only to one domain
I currently have
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ ^ezrahub.com/index.php/$1 [QSA,L]
</IfModule>
Which is ...
0
votes
2answers
88 views
simple nginx rewrite rule
I need to rewrite (convert) this basic htaccess rules to nginx format. Can you help me? Thanks.
RewriteEngine On
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteCond %{SCRIPT_FILENAME} !-f
...
1
vote
2answers
75 views
RewriteRule only works if folder does not exist
Instead of directly accessing images, I need to use RewriteRule to redirect a set of images to be accessed via a script.
A RewriteRule is used for it:
RewriteRule ^Images/test/([^.\/]*)\.png ...
0
votes
1answer
47 views
Keeping Rewrite but allowing hotlinking in htaccess
Hiz
I have already asked this question few days back but havent received any answer yet.so i am going to delete that and re ask here.
I have this .htaccess rewrite rule which redirects/rewrites ...
1
vote
0answers
26 views
Static site to dynamic - rewrite loop
I have wordpress installed in a subdirectory of the root. I have followed the instructions provided to put index.php in root and create appropriate htaccess file. Site is up and running. Can access as ...
1
vote
2answers
69 views
Easiest way to implement url rewriting for multiple VHost on Nginx
I have a lot of Vhost on my server, and I'm looking for a way to easily configure Url rewriting without having to open Putty, connect on SSH and editing with vim.
Is it possible to put the rewrite ...
0
votes
0answers
71 views
.htaccess - Simulating virtual host wrong link to Parent Directory in Directory Listing
I have a domain dedicated for my local server (.dev), and an .htaccess file which redirects requests like http://folder.dev/subfolder/ to /htdocs/folder/subfolder. It works great and all, except for ...
2
votes
1answer
67 views
Redirect one or more URL to just one, with regular expressions
In my website I have some pages that are reachable by two urls:
.../page
.../parameter/page
In order to optimize the website for the search engines, I have to redirect all .../page urls to ...
2
votes
1answer
39 views
Protecting Directory with .htaccess
Unfortunately with a product I rolled out, blackhatters found they could access an unprotected directory where I had the zip files. I use PHP to serve up those zips with readfile(), so normally in my ...
0
votes
1answer
61 views
existing file gives 404 due to a RewriteCond rule in .htaccess
To redirect a specific domain name to a folder in my public dir, www/, I edited .htaccess to the following:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^(.+)?domain.com$
RewriteRule ^(/)?$ ...
0
votes
1answer
42 views
.htaccess Not Working as Expected
I have a hosted account not linked to any domain at /~me.
In the top level of my home directory I have a .htaccess file:
Options +FollowSymlinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ...
0
votes
1answer
111 views
nginx: rewrite a non-existent php-file to another php-file with all arguments
i really need help here. Sitting for some time now and dont figured it out.
I want to realize a very simple task - rewrite a non-existent php file to another existant php file with all arguments ...
0
votes
0answers
67 views
.htaccess redirect for www in parent folder and children react
We were having a problem with the Norton seal not showing up on our affiliate marketing landing pages (landers). Turns out, the Norton seal was super picky about the "www." prefix. I had folder paths ...
0
votes
0answers
172 views
htaccess rewrite rules in Nginx: setting the rewrite path
I have a htaccess file I'm trying to convert into an nignx config file.
Here's my htaccess file.
RewriteEngine on
RewriteCond %{SCRIPT_FILENAME} !-f
RewriteCond %{SCRIPT_FILENAME} !-d
RewriteRule ...
0
votes
0answers
199 views
htaccess exclude file from rewrite condition
I found an article to protect the wp-admin/ and wp-login.php locations of my Wordpress installation.
When the locations are accessed w/o a "query string" the address is redirected.
If the locations ...
0
votes
1answer
150 views
Redirect non-existent subdomain to base domain url
I was using Droplr with my domain, 'example.com', prepended with 'u.'. (u.example.com). The prepend was not a subdomain, and would redirect to Droplr via an A record to their server's IP Address.
...
0
votes
0answers
171 views
HTACCESS Request exceeded the limit of 10 internal redirects due to probable configuration error
There are similar questions being asked about the same thing, but this has all of a sudden happened to me. No code was changed, just woke up to find apache using up way too much memory. The error I'm ...
1
vote
1answer
52 views
how to make this htacess rewrite rule stop failing because of final parameter
I have this URL rewrite rule
RewriteRule ^(send-your-request.*)$ / [NC,L,QSA,R=301]
it should basically just remove "/send-your-request" from the the URL (i.e. rewrite it with query string ...
0
votes
1answer
155 views
Apache2 URL Rewrite - Second-Level-Domain to the end of URL
i have a site "example.com" and also many other domains like "example1.com", "example2.de", etc.
I want that every Second-Level-Domain is rewritten in the following way:
...
0
votes
0answers
22 views
Rewrite a URL with a Real Directory In It?
I have a directory on my server:
http://mydomain.com/simfiles
I want an htaccess rewrite rule that will take a url that looks like
http://mydomain.com/simfiles/somedir1/somedir2
Where those are ...
0
votes
0answers
12 views
HTACCESS cutting string Redirect 301 [duplicate]
Possible Duplicate:
Everything You Ever Wanted to Know about Mod_Rewrite Rules but Were Afraid to Ask?
1) I need to cut off the first word in the first two slashes in the url (including ...
0
votes
1answer
142 views
Apache Proxy and Rewrite, append directory to URL
I have a backend server running on http://10.0.2.20/ from the local network, which serves similar to this:
/ (root)
|
|_user1/
| |_www/
| |_private/
|
|_user2/
|_www/
|_private/
(etc.)
...
1
vote
1answer
97 views
htaccess rewrite?
i have a script that uploads images, creates a hash for it, creates 3 directories, and stores the image to
imgs/f3s/v5g/234/536_f3sv5g2344270fd093ee8a9bf8de3de32dad.jpg
(the “536_” is the user id)
...
1
vote
1answer
121 views
Universal rewrite rule for versioning css/js files?
Is there any universal rule to rewrite versions?
/css/main.123456.css rewrite to /css/main.css
/css/styles.123456.css rewrite to /css/styles.css
/js/application.123456.js rewrite to ...
0
votes
1answer
424 views
Redirect 404 errors without rewriting the URL
Is it possible to have an erroneous URL remain in the address bar while redirecting the user to a URL within my domain? I want www.domain.com/forum to be the actual site being served in all 404 ...
3
votes
1answer
324 views
How to exclude IP from htaccess domain redirect
I'm trying to write a custom redirect rule for some testing purposes on 2 domains with exactly same site. The code I am using is:
RewriteEngine on
RewriteCond %{REMOTE_ADDR} !^1\.2\.3\.4$
...
0
votes
1answer
120 views
htaccess to get content from another folder [closed]
I posted this question on wordpress.stackexchange.com but they said this question is a server configuration, so I reposted it here.
I'm using nextgen gallery plugin in my blog. The default folder for ...
1
vote
1answer
43 views
Configuring HTACCESS in a sub directory
I have an htaccess file in my main directory which redirects all top-level directories to a PHP file.
-> /Loch would go to /profile.php?username=Loch
But I also have a subdirectory, lets call it ...
1
vote
1answer
50 views
Dynamic to static
My site is an e-commerce site. All URLs are dynamic, like "my_domain/a.php", "my_domain/a.php?id=1", "my_domain/b.php", "my_domain/b.php?id=3", etc.
I want static URLs like ...
0
votes
1answer
29 views
Htaccess Rewrite Code
I have a website that is the root folder It has a .htacces with below code :
RewriteEngine on
RewriteRule ^(.*)/$ $1.php
When I open http://mysite.com/login/ I got 404 not found error but when I ...
0
votes
1answer
41 views
Tracking down a strange apache rewrite
The tl:dr; How would you go about tracking down a url rewrite that should not be happening?
The details:
I have one .htaccess file and it is simply:
RewriteEngine On
RewriteCond ...
3
votes
1answer
149 views
Trouble with www. redirect (.htaccess)
I'm trying to get a simple www. to non www. redirect set up. Here's the .htaccess
DirectoryIndex index.php
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www.domain.org [NC]
RewriteRule ^(.*)$ ...
0
votes
1answer
229 views
htaccess rewrite subdomain and requests uri
Having trouble with a rewrite condition within my htaccess. I need to redirect the request from a subdomain. However, there are three subdomains for each language: en.foo.com, es.foo.com, www.foo.com. ...
2
votes
7answers
2k views
Excluding a directory from a root .htaccess rewrite rule to allow it to be password protected?
I have spent a tremendous amount of time the last week trying to figure this out, but no matter what I try I cannot get this to work. My web host said they did not have anyone who knew enough about ...
0
votes
1answer
42 views
How to redirect requests to my URL to somefile.php not index.php
How can i redirect all the requests that are made to www.mysite.com to www.mysite.com/index_main.php and then rewrite www.mysite.com/index_main.php as www.mysite.com
0
votes
1answer
62 views
Reg Expression htaccess RewriteRule
I am new to using regular expressions for rewriting URL's in htaccess
I need to redirect mysite.com/123 to mysite.com/, IF cookie named 'ref' is set.
my current htaccess is:
<IfModule ...
0
votes
0answers
29 views
htaccess rules for displaying home page from one website & display other pages from another website
I want to display the homepage of www.mydomain.com but for links on this page such as www.mydomain.com/file1.php should display files from www.yourdomain.com/file1.php
while the url in the address ...
0
votes
2answers
95 views
.htaccess rewrite all queries to static page
I have an account where hundreds of inbound links to their calender are showing up as 404 (they moved their site to a new platform). I would like to make a wildcard redirection of all URLs with a ...
0
votes
1answer
55 views
.htaccess rewrite issue
Below is my .htaccess file for my website on shared hosting - I'm attempting to send all requests to index.php with parameter 'q' where I wish to parse data etc... unless it's an existing file or ...
0
votes
1answer
371 views
Multiple RewriteCond doesn't work
I have in htaccess some like this:
RewriteCond %{HTTP_HOST} !^foo
RewriteCond %{HTTP_HOST} !^bar
RewriteCond %{HTTP_HOST} !^some
RewriteRule ^register,(.*)$ /register.html [R=301,L]
RewriteRule ...