Search Results

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

Page 30/128 | < Previous Page | 26 27 28 29 30 31 32 33 34 35 36 37  | Next Page >

  • Rewriting URLs from subdomain to domain in Apache

    - by Nazgulled
    Hi, My webserver is running Plesk and part of my site structure goes like this: / /httpdocs (domain root folder, URL: http://www.domain.com) /subdomains /subdomains/blog/httpdocs (blog root folder, URL: http://blog.domain.com) I have a WordPress installation in the domain root folder and WP is configured to display a static page when accessing www.domain.com and to display the blog when accessing www.domain.com/blog. However, I want to redirect (using mod_rewrite) all requests from http://blog.domain.com/ to http://www.domain.com/blog/. A few examples: Accessing http://blog.domain.com/archives should access http://www.domain.com/blog/archives/ Accessing http://blog.domain.com/tag/abc should access http://www.domain.com/blog/tag/abc/ Accessing http://blog.domain.com/some-post-title should access http://www.domain.com/blog/some-post-title All this should be transparent to the user, the address shouldn't be changed on the browser's address bar. In better words, I want a URL rewrite and not a URL redirect. Is this achievable with mod_rewrite? Can anyone help me with the .htaccess? All my attempts on doing so have failed...

    Read the article

  • Apache misbehaving (returning 404s)

    - by OC2PS
    CentOS 6.4 64-bit Apache 2.4.6 PHP-FPM 5.5.4 Homepage from root loads fine http://csillamvilag.com But all other pages return 404 (CMS is WordPress). I am also able to access and log into WordPress backend. Additionally, Menalto Gallery 3 seems to be loading ok http://csillamvilag.com/kepek/ but all OpenCart pages return 404 http://csillamvilag.com/shop/ or http://csillamvilag.com/shop/hu/ Apache is running as user apache. All relevant WordPress and OpenCart files are owned by user apache. I have a suspicion that it might be a rewrite issue, but I checked .htaccess for both WordPress and OpenCart, and they look ok. e.g. WordPress/root .htaccess is: # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule>

    Read the article

  • nginx reverse proxy hide redirects

    - by NZCoderGuy
    I've Nginx as a reverse proxy for two sites A and B running behind. The users go from public - reverse proxy - site A - site B (from A to B clicking links) What would be a typical configuration for a scenario like this? The url in the browser should be always the reverse proxy This is what I've so far but is not working worker_processes 2; error_log logs/error.log info; events { worker_connections 1024; } http { server { resolver 127.0.0.1; listen 8080; location / { set $target 'siteA'; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header Host $http_host; rewrite ^(.*) $1 break; proxy_pass http://$target; } } }

    Read the article

  • Prevent redirect loop in mod_rewrite

    - by user280381
    I'm writing a rule in my htaccess that basically says this: If the request is for the homepage And a cookie has not been set Rewrite the page with /addCookie.php Then in addCookie.php, we set the cookie and redirect back to the homepage. This is all fine, but if the user doesn't accept cookies, we get an infinite loop of redirects. I'm new to mod_rewrite, I've done a lot of searching, but can't break the loop. I have this so far: RewriteCond %{ENV:REDIRECT_STATUS} 200 RewriteRule .* - [S=1] RewriteCond %{REQUEST_URI} "^/$" RewriteCond %{HTTP_COOKIE} !device_detected RewriteRule ^ addCookie.php [L] Is what I'm trying to do possible? I could add a query string on the redirect from addCookie.php, but I'd much rather keep the requests identical. Any suggestions kindly welcome.

    Read the article

  • send apache request identifier to backend when using mod_rewrite

    - by Jose L Martinez-Avial
    I'm using mod_rewrite to send requests from the client to a backend server. I've seen in the rewrite log that Apache sets a sid (Session Identifier?) and rid (request identifier?) and shows them in the logs. Would it be possible to send the rid to the backend server as a http header? that way I can link a request in the apache with a request in the backend server. [localhost/sid#7f48e8ad2968][rid#7f48e8e634c8/initial] (3) ... Thanks

    Read the article

  • unique .htaccess question about mod_rewrite and RewriteCond

    - by Stephen
    I have a few rewrite rules like these RewriteRule ^dir/(.*)-something.html otherdir/file1.php?var1=val&var2=$1 [L,NC] RewriteRule ^dir/ otherdir/file2.php?var1=val [L,NC] dir/ is not a real directory. Everything above works as expected. However, the user is able to type anything like mysite.com/dir/asdfasdfasdfsdf And they are still redirected to file2.php. If the user types in just garbage I'd like to serve a 404 instead. I'm guessing I need a RewiteCond that will test for blank space after the slash and only then serve file2.php, but I'm unsure how to write it.

    Read the article

  • apache2 mod_rewrite enable, but not working

    - by user611478
    I have enabled mod_rewrite on my server and confirmed it using phpinfo() and it shows as enabled. I have the following in my httpd.conf file: ServerName 172.16.1.114 RewriteEngine on RewriteRule ^/test$ /index.php I've tried the rewrite rule on another server and it works as expected. No errors are thrown to my apache error log and it restarts cleanly. When I try the page it 404s and doesn't load index.php I'm sure this must be a simple problem, but I am at a loss on how to figure it out. Any help is appreciated.

    Read the article

  • vhost.conf with plesk makes infinite loop

    - by user134598
    So I'm trying to make rewrite rules for my just migrated site and now we're using PLESK (unfortunately in my opinion). So, in order to make those rewrites I'm using the vhost.conf file in mydomain/conf folderm and I execute: /usr/local/psa/admin/sbin/websrvmng -u --vhost-name=mydomain.org so that includes my file into the httpd configuration. However, no matter what I write in my vhost.conf file, it will make my site go in an infinite loop whenever I try to load an URL that's not just the domain. Example: mydomain.org Works just fine. mydomain.org/event/nameofevent Will try endlessly to load and eventually my browser will detect that infinite loop. I though I was writing something incorrectly in my vhost.conf file but I even tried it with the file empty (not a single line). It will still try to load endlessly. Anybody can hint me if I'm skipping a step before (like any activation that should be done beorehand or something). Thanks in advance.

    Read the article

  • .htaccess redirect - Is it secure?

    - by thecrandallster
    This works; I'm not having trouble, but I want to be certain that this is bulletproof. I came up with a neat little .htaccess redirect, but I am not sure if it is secure; do you know? <IfModule mod_rewrite.c     RewriteEngine On     RewriteRule ^goto/([a-z]+)/?$ /$1/ [R] </IfModule I think as long as the server is configured correctly and the files handle authentication autonomously, then it shouldn't be a security issue. Also, being that the rewrite rule only works with characters a-z and one slash I doubt they could jump around directories by injecting stuff into the URL I think...

    Read the article

  • Disabling URL decoding in nginx proxy

    - by Tomasz Nurkiewicz
    When I browse to this URL: http://localhost:8080/foo/%5B-%5D server (nc -l 8080) receives it as-is: GET /foo/%5B-%5D HTTP/1.1 However when I proxy this application via nginx: location /foo { proxy_pass http://localhost:8080/foo; } The same request routed through nginx port is forwarded with path decoded: GET /foo/[-] HTTP/1.1 Decoded square brackets in the GET path are causing the errors in the target server (HTTP Status 400 - Illegal character in path...) as they arrive un-escaped. Is there a way to disable URL decoding or encode it back so that the target server gets the exact same path when routed through nginx? Some clever URL rewrite rule?

    Read the article

  • Order of mod_rewrite rules in .htaccess not being followed

    - by user39461
    We're trying to enforce HTTPS on certain URLs and HTTP on others. We are also rewriting URLs so all requests go through our index.php. Here is our .htaccess file. # enable mod_rewrite RewriteEngine on # define the base url for accessing this folder RewriteBase / # Enforce http and https for certain pages RewriteCond %{HTTPS} on RewriteCond %{REQUEST_URI} !^/(en|fr)/(customer|checkout)(.*)$ [NC] RewriteRule ^(.*)$ http://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] RewriteCond %{HTTPS} off RewriteCond %{REQUEST_URI} ^/(en|fr)/(customer|checkout)(.*)$ [NC] RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] # rewrite all requests for file and folders that do not exists RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php?query=$1 [L,QSA] If we don't include the last rule (RewriteRule ^(.*)$ index.php?query=$1 [L,QSA]), the HTTPS and HTTP rules work perfectly however; When we add the last three lines our other rules stop working properly. For example if we try to goto https:// www.domain.com/en/customer/login, it redirects to http:// www.domain.com/index.php?query=en/customer/login. It's like the last rule is being applied before the redirection is done and after the [L] flag indicating the the redirection is the last rule to apply.

    Read the article

  • Redirecting to a diferent exe for download based on user agent

    - by Ra
    I own a Linux-Apache site where I host exe files for download. Now, when a user clicks this link to my site (published on another site): http://mysite.com/downloads/file.exe I need to dynamically check their user agent and redirect them to either http://mysite.com/downloads/file-1.exe or http://mysite.com/downloads/file-2.exe It seems to me that I have to options: Put a .htaccess file stating that .exe files should be considered to be scripts. Then write a script that checks the user agent and redirects to a real exe placed in another folder. Call this script file.exe. Use Apache mod-rewrite to point file.exe to redirect.php. Which of these is better? Any other considerations? Thanks.

    Read the article

  • Mod_rewrite pretty url when domain/foo is a directory

    - by ModRewriter
    Starting with something as simple as: RewriteRule ^(.*)$ index.php?page=$1 What if I also want the following to work: RewriteRule ^/foo$ /index.php?page=foo #/foo IS a directory This seem to work ONLY if the R flag is set, but then the full non-pretty url is written. Thus it seems I can REDIRECT existing directory, but not rewrite them... Maybe with an .htaccess inside the directory itself? Or some PHP magic in /foo/index.php like header(/index.php?page=foo)? Will it work? Will it be HTTP standard/search engine optimized? Please help! PS: The oddest idea occurred to me: redirecting /foo to /not-a-dir, and then rewriting /not-a-dir to /index.php?p=foo should theorically work... But... Come on... Really?!?

    Read the article

  • Help with Apache rewriteengine rules

    - by Vinay
    Hello - I am trying to write a simple rewrite rule using the rewriteengine in apache. I want to redirect all traffic destined to a website unless the traffic originates from a specific IP address and the URI contains two specific strings. RewriteEngine On RewriteLog /var/log/apache2/rewrite_kudithipudi.log RewriteLogLevel 1 RewriteCond %{REMOTE_ADDR} ^199\.27\.130\.105 RewriteCond %{REQUEST_URI} !/StringOne [NC, OR] RewriteCond %{REQUEST_URI} !/StringTwo [NC] RewriteRule ^/(.*) http://www.google.com [R=302,L] I put these statements in my virtual host configuration. But the rewriteengine seems to be redirect all requests, whether they match the condition or not. Am I missing something? Thank you. Vinay.

    Read the article

  • Make shortened and long urls play together on the same domain (RewriteRule).

    - by Renato Renato
    Long story short, I want to have both example.com/aJ5 and example.com/any-other-url working together. I'm using apache and not very good at writing regex. I have already a global RewriteRule which sends everything to the app entry point. What I need is to tell apache if length($path) is <= 5 chars then rewrite to another location. I know I can use {1,5} like syntax in regex, but don't really know if it's what I'm looking for. I'd like to implement this at web-server level rather than php level. Any help is appreciated.

    Read the article

  • FreeBSD Server .htaccess issues

    - by Will Ayers
    Server Details: FreeBSD PHP Version 4.3.11 Apache Appache Modules: mod_throttle, mod_php4, mod_speedycgi, mod_ssl, mod_setenvif, mod_so, mod_unique_id, mod_headers, mod_expires, mod_auth_db, mod_auth_anon, mod_auth, mod_access, mod_rewrite, mod_alias, mod_actions, mod_cgi, mod_dir, mod_autoindex, mod_include, mod_info, mod_status, mod_negotiation, mod_mime, mod_mime_magic, mod_log_config, mod_define, mod_env, mod_vhost_alias, mod_mmap_static, http_core The issue I am having is when ever I write any kind of code in the .htaccess file, it throws a 500 Internal error I am simply trying to rewrite url's and am using the exact code that wordpress creates for me and even tried custom code used before on previous servers and it still does not work. WordPress created code: # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase /lobster-tail-blog/ RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /lobster-tail-blog/index.php [L] </IfModule> # END WordPress And even a simple thing like this throws the error: <IfModule mod_rewrite.c> RewriteEngine On </IfModule> Anyone know of any fixes or why this is causing this error? I have the mod_rewrite module loaded

    Read the article

  • Forwarding 80 to 443 on Nagios woes

    - by Ethabelle
    I perhaps just need some extra insight because I don't see where I'm going wrong. I used an SSL Cert to secure our nagios server. We want to specifically require all traffic over nagios (like 2 users, lol) to use SSL. So I thought, oh, mod_rewrite + Rewrite Rule in .htaccess, right? So I went into the DocumentRoot and did a vi .htaccess (one didn't already exist) and then I put in the following rule; RewriteEngine On RewriteCond %{SERVER_PORT} 80 RewriteRule ^(.*)$ https://our.server.org/$1 [R,L] This does absolutely nothing. Does nada. Whhhyy.. Note: AllowOverride all in httpd.conf is on. Also, I verified that the module is not uncommented out ... but note, I couldn't find the mod_rewrite module installed so I copied it over from another server and placed it in modules/mod_rewrite.so . It was weird because it was enabled in the httpd.conf file, but then didn't exist in modules ... I'm a baddie :(

    Read the article

  • Point subdirectory to another domain is IIS 6

    - by Liviu
    Is it possible to rewrite somehow www.mysite.com/Pictures to point to test.mysite.com/Pictures or even more broadly www.someothersite.com/Pictures ? Note: www.mysite.com and test.mysite.com are on separate machines and built with different technologies (one is ASP.NET and the other is PHP) but I have access to both of them. I want that when I reference a picture like www.mysite.com/Pictures/pic12345.png the picture to display correctly, even though there is not /Pictures folder on that server and the pictures has to be retrieved by going to test.mysite.com/Picture/pic12345.png Ideally I want to do this in IIS6 to test it. However I am interested if it possible to do in any webserver (Apache, IIS7)

    Read the article

  • Need help with an .htaccess URL rewriter

    - by AlexV
    I'm trying to do another SEO system with PHP/.htaccess... I need the following rules to apply: Must catch all URLs that do not end with an extension (www.foo.com -- catch | www.foo.com/catch-me -- catch | www.foo.com/dont-catch.me -- don't catch). Must catch all URLs that end with .php* (.php, .php4...) (thwaw are the exceptions to rule #1). All rules must only apply in some directories and not in their subdirectories (/ and /framework so far). The htaccess must send the typed URL in a GET value so I can work with it in PHP. Any mod-rewrite wizard can help me?

    Read the article

  • Redirect to new domain and preserve username

    - by David Brown
    I recently switched to a new domain for a version control server I run. The server is usually accessed with a username included in the url such as https://[email protected]/some/stuff. I want to redirect requests to the old domain to the new domain and preserve everything else in the url (including the username). So the former url would be redirected to https://[email protected]/some/stuff. Currently I have the following rewrite condition and rule: RewriteCond %{HTTP_HOST} sub\.olddomain\.com RewriteRule (.*) https://sub.newdomain.net$1 [R=301,L] This works except it drops the userinfo part of the URL. Is there a way I can preserve the user info?

    Read the article

  • Forward requests to IIS Application/Folder to Apache server on another port

    - by TheGwa
    I have found many questions and answers for ways of doing this using asapi filters or ARR and URL Rewrite, but none are clear and concise and I am sure many people have this issue. I am looking for a best practice step by step solution to the following scenario: I have a development server accessible externally via a specific port for testing. Eg. rnd.domain.com:8888. So there is one port in and out of this machine accessible to the world. On this server I have a number of Apache or other servers using specific ports such as 8080. IIS is bound to port 80 locally as well as 8888 to get external requests and works perfectly. I would like to use an application (folder) in IIS such as rnd.domain.com:8888/mapserver to map to the local apache server in both directions. The same solution must apply in production where the domain is mapped to port 80. eg. production.domain.com/mapserver maps to 8080 on production server

    Read the article

  • Apply SetEnvIf after Apache RewriteRule

    - by coneybeare
    I have a working apache rewrite rule: RewriteCond %{HTTP_HOST} ^.*foo.com RewriteRule (.*) http://bar.com$1 [R=301,QSA,L] and some working dontlog SetEnvIfs: SetEnvIf Request_URI "^/server-status$" dontlog SetEnvIf Request_URI "^/home/ping$" dontlog SetEnvIf Request_URI "^/haproxy-status$" dontlog SetEnvIf User-Agent ".*internal dummy connection.*" dontlog CustomLog /var/log/apache2/access.log combined env=!dontlog but I can't figure out how to stop the RewriteRule from logging a duplicate line. foo.com and bar.com are both on the same machine. I would expect this rule to work, but it did not: SetEnvIf Host "foo.com" dontlog I still get duplicates in the Apache Log: 10.250.18.97 - - [06/Apr/2012:16:57:12 +0000] "GET / HTTP/1.1" 200 732 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_3) AppleWebKit/534.55.3 (KHTML, like Gecko) Version/5.1.5 Safari/534.55.3" 68.194.30.42 - - [06/Apr/2012:16:57:12 +0000] "GET / HTTP/1.1" 200 732 "-" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_3) AppleWebKit/534.55.3 (KHTML, like Gecko) Version/5.1.5 Safari/534.55.3" .... where 10.250.18.97 is the server's IP. How can I prevent that RewriteRule from logging?

    Read the article

  • Add trailing slash when it's missing in nginx

    - by vvanscherpenseel
    I'm running Magento on Nginx using this config: http://www.magentocommerce.com/wiki/1_-_installation_and_configuration/configuring_nginx_for_magento. Now I want to 301 all URLs without trailing slash to their counterpart that includes a trailing slash. For example: /contacts to /contacts/. I've tried virtually all the nginx directives on this I could find, but to no avail. For example, the directive specified in nginx- Rewrite URL with Trailing Slash leads to a redirect to /index.php/. Which directive should I add and where?

    Read the article

  • Apache expands REQUEST_FILENAME with filetype

    - by Lauer
    I have a .htaccess fil on a Apache22 server. RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.+)$ /index.php?p=$1 [L] The idea is when the request is /testpage it should be rewritten to /index.php?p=testpage. The problem is that apache does a write before my file, so the actually request is testpage.xml which actually does exists. Therefore, the first RewriteCond is newer true, and my rewrite rule is never applied on the /testpage request. There server should be a standard setup on a FreeBSD server. I know this work on other servers.

    Read the article

  • Need help with an .htaccess URL redirector

    - by AlexV
    I'm trying to do another SEO system with PHP/.htaccess... I need the following rules to apply: Must catch all URLs that do not end with an extension (www.foo.com -- catch | www.foo.com/catch-me -- catch | www.foo.com/dont-catch.me -- don't catch). Must catch all URLs that end with .php* (.php, .php4...) (thwaw are the exceptions to rule #1). All rules must only apply in some directories and not in their subdirectories (/ and /framework so far). The htaccess must send the typed URL in a GET value so I can work with it in PHP. Any mod-rewrite wizard can help me?

    Read the article

< Previous Page | 26 27 28 29 30 31 32 33 34 35 36 37  | Next Page >