Search Results

Search found 20405 results on 817 pages for 'url rewrite'.

Page 8/817 | < Previous Page | 4 5 6 7 8 9 10 11 12 13 14 15  | Next Page >

  • URL rewrite module for IIS7

    - by Learner
    I am trying to test if the redirect that I wrote works or not. If I do IISReset the redirect does not work. But if I recycle the app then this works. Is this how it works? <rule name="RedirectToanothercity" patternSyntax="ECMAScript" stopProcessing="true"> <match url="^home/cities.aspx?$" /> <conditions> <add input="{QUERY_STRING}" pattern="city=jerseycity" /> </conditions> <action type="Redirect" url="jerseycity" appendQueryString="false" />

    Read the article

  • Remove .php extension (explicitly written) for friendly URL

    - by miquel
    htaccess to remove the .php extension of my site's files. RewriteEngine on RewriteBase / RewriteCond %{SCRIPT_FILENAME} !-d RewriteCond %{SCRIPT_FILENAME} !-f RewriteRule ^(.*)$ $1.php [L,QSA] Now, if I go to my site www.mysite.com/home works fine, it redirects to home.php but the URL is still friendly. But if I write this URL: www.mysite.com/home.php The home.php is served, and the URL is not friendly. How can I avoid this behavior? I want that if the user writes www.mysite.com/home.php, the URL displayed in the URL bar be www.mysite.com/home

    Read the article

  • Htaccess rewrite rule .aspx to .php

    - by Markus Ossi
    Background: I have a website that has been built with ASP.NET 2.0 and is on Windows hosting. I now have to rewrite my site in PHP and move it into Linux hosting. I have a lot of incoming links to my site from around the web that point directly into the old .aspx-pages. The site itself is very simple, one dynamic page and five static ones. I saved the static .aspx pages as .php-pages and rewrote the dynamic page in PHP. The dynamic page is called City.aspx and I have written it in PHP and it is now called City.php. On my old Windows hosting, I used ASP.NET's URL mapping for friendly URL. For example, incoming URL request for Laajakaista/Ypaja.aspx was mapped into City.aspx?CityID=981. My goal: To redirect all human visitors and search engines looking for the old .aspx pages into the new .php pages. I am thinking that the easiest way to redirect visitors into new pages will be by making a redirect, where all requests for .aspx-files will be redirected into .php filetypes. So, if someone asks for MYSITE/City.aspx?CityID=5, they will be taken into MYSITE/City.php?CityID=5 instead. However, I am having a lot of trouble getting this to work. So far this is what I have found: rewriterule ^([.]+)\.aspx$ http://www.example.com/$1.php [R=301,L] However, I think this can not handle the parameters after the filetype and I am also not quite sure what to put on front. To make things a bit more complicated, at my previous site I used friendly URL's so that I had a huge mapping file with mappings like this: <add url="~/Laajakaista/Ypaja.aspx" mappedUrl="~/City.aspx?CityID=981" /> <add url="~/Laajakaista/Aetsa.aspx" mappedUrl="~/City.aspx?CityID=988" /> <add url="~/Laajakaista/Ahtari.aspx" mappedUrl="~/City.aspx?CityID=989" /> <add url="~/Laajakaista/Aanekoski.aspx" mappedUrl="~/City.aspx?CityID=992" /> I tried to make a simple redirect like this: Redirect 301 Laajakaista/Aanekoski.aspx City.php?CityID=992 but was not able to get it to work. I ended up with an internal server error and a 50k .htaccess-file... Any help is greatly appreciated.

    Read the article

  • Rewrite rules doesn’t work apache 1.3

    - by Sander Versluys
    I'm using a couple of rewrite directives that always works before on apache2 but now i'm trying new a shared hosting and the rewrite rules do not seem to get applied. I've reduced the .htaccess files to the following essential rules: RewriteEngine On Rewritebase /demo/ RewriteRule ^(.*)$ index.php/$1 [L] As you can see, i want to rewrite every request to my index.php file in the demo folder from root. So everything like http://www.example.com/demo/albums/show/1 should be processed by http://www.example.com/demo/index.php for a standard MVC setup. (I'm using CodeIgniter btw) The directives above results in a 500 error, so i thought maybe because of some possible syntax differences between 1.3 and 2.x. After some trail and error editing, i've found the rewrite rule itself to be at fault but i really don't understand why. Any ideas to why my rewrite rule doesn't work? it did before on lots of different servers. Suggestions how to fix it? Note: mod_rewrite does work, i've written a small test to be sure

    Read the article

  • How to setup .htaccess to rewrite to different folder

    - by Guy
    I'm moving my site to a new host but I need to have my current server continue to handle requests (not all files can be moved to the new server). So I added a parked domain to my old server (old.mydomain.com) and I want all requests to it to be written to the files from the old site. My old site (mydomain.com) was hosted internally in a folder (/public_html/mydomain/) and I want all requests to old.mydomain.com to be rewritten to the same folder. So if mydomain.com/blog was internally at /public_html/mydomain/blog I now want old.mydomain.com/blog also to reach /public_html/mydomain/blog. Here is the .htaccess that I'm trying to use: RewriteCond %{HTTP_HOST} ^old\.mydomain\.com/* RewriteRule ^(.*)$ mydomain/$1 [NC,L] but for some reason as soon as I add the $1 in the rewrite rule I get an internal error. Any ideas?

    Read the article

  • URL Rewriting for user accounts

    - by Igor K
    We currently have domain.com/username redirected to domain.com/setsession.asp?u=username which then redirects to the app at domain.com/theapp. This means users always see domain.com/theapp, so browsing to a page shows domain.com/theapp/somepage.asp Looking to move this to subdomains ie username.domain.com (we'll get the host name and work out the user from that). How can this be set up? Should we move the app itself to say theapp.domain.com and then rewrite username.domain.com to theapp.domain.com and everything works? If thats right, how can we do the URL rewrite (mod_rewrite via ISAPI Rewrite for IIS or URL Rewriting for IIS) so that we can still access webmail.domain.com, etc?

    Read the article

  • Using htaccess rewrite to make a subdirectory be its own root for root relative path requests

    - by Scott
    Can I use htaccess to capture requests from a certain subdirectory and make that directory use itself as the root directory for any root relative path requests? For example if I have... http://www.example.com/subFIXED/subANY/restofpath ...where subFIXED is always the same directory, subANY is any immediate subdirectory of subFIXED, and I want a redirection of all href/src requests from any file under subANY to use subANY as the 'root' (sort of like a subdomain), in effect having root level requests use this as the root directory level: http://www.example.com/subFIXED/subANY/ Instead of this: http://www.example.com/ I'm assuming I can put an htaccess file in subFIXED to handle all calls coming from anything under any subANY, but not being very familiar with htaccess rewriting, variables, etc., I can't figure out how to capture which subANY directory is making the root level request and then use that capture to make a rewrite to consider that directory the root level of any root relative path requests from it. Thanks for your help

    Read the article

  • How to successfully Rewrite a URL with .htaccess

    - by Ian Storm Taylor
    Hello. I am trying to rewrite mysite.com/broadcasts to mysite.com/feed so that it will show up in the location bar as "broadcasts" but actually go to /feed. Here is what I have in the .htaccess file: <IfModule mod_rewrite.c> RewriteEngine on RewriteRule ^broadcasts(/)?$ /feed/ </IfModule> But this isn't working... I get a 404 error. Wondering if I'm doing something stupidly wrong. Thanks!

    Read the article

  • How would you rewrite/refactor this ?

    - by frostings
    Old application that is used by 50-60.000 paying customers. Company is several hundred people big. Application has a lot of business critical code (30% of all code) written in classic asp. Application has a lot more .net code. Application has a COM+ bridge for enabling asp to "talk" to .net Organization lacks some/a lot knowledge on what is causing the 10-20% server-reset per day (might be due to COM+ ?) There is no red line through the application; no architecture, no real patterns etc. The application has been like this for at least 5 years. The asp code base is increasing, slowly but certainly. I have read refactoring stories and I have knowledge on why you some of the times should not re-write a system. I would love for the old asp code to vanish as well as the COM+ component. But the pain is that no one really knows what is going on inside the asp classic code and the attitude inside all the teams are "this is just how it is". Down the line, this causes a lot of other issues like recruiting, dev effeciency, business needs that cannot be met, scale etc. With these little facts, does that justify a re-write of the asp code and the removal of the COM+ component ? How would you go about it ?

    Read the article

  • Setting up a Reverse Proxy using IIS, URL Rewrite and ARR

    - by The Official Microsoft IIS Site
    Today there was a question in the IIS.net Forums asking how to expose two different Internet sites from another site making them look like if they were subdirectories in the main site. So for example the goal was to have a site: www.site.com expose a www.site.com/company1 and a www.site.com/company2 and have the content from “www.company1.com” served for the first one and “www.company2.com” served in the second one. Furthermore we would like to have the responses cached in the server for performance...(read more)

    Read the article

  • Error 404 after rewrite query strings with htaccess

    - by Cristian
    I'm trying to redirect the URLs of a client's website like this: www.localsite.com/immobile.php?id_immobile=24 In something like this: www.localsite.com/immobile/24.php I'm using this rule in .htaccess but it returns a 404 error page. RewriteEngine On RewriteCond %{QUERY_STRING} ^id_immobile=([0-9]*)$ RewriteRule ^immobile\.php$ http://localsite.com/immobile/%1.php? [L] I have tried many other rules, but none work. What can I do?

    Read the article

  • URL Rewrite 2.0 Performance

    - by The Official Microsoft IIS Site
    Do performance work it is easy when you have the right tools for measuring gains or lost. I will share some thoughts about how to improve performance during rewriting, but please keep in mind that any change you do must be well thought and with performance Read More......( read more ) Read More......(read more)

    Read the article

  • Rewrite for robots.txt and favicon.ico

    - by BHare
    I have setup some rules in which subdomains (my users) will default to where I have located the robots.txt, favicon.ico, and crossdomain.xml therefore if a user creates a site say testing.mywebsite.com and they don't make their own favicon.ico at testing.mywebsite.com/favicon.ico, then it will use the favicon.ico I have in /misc/favicon.ico This works perfect, but it doesn't work for the main website. If you attempt to go to mywebsite.com/favicon.ico it will check if "/" exists, in which it does. And then never redirects to /misc/favicon.ico How can I get it so both instances redirect to /misc/favicon.ico ? # Set all crossdomain (openpalace file) favorite icons and robots.txt doesnt exist on their # side, then redirect to site's just to have something to go on. RewriteCond %{REQUEST_URI} crossdomain.xml$ RewriteCond ^(.+)crossdomain.xml !-f RewriteRule ^(.*)$ /misc/crossdomain.xml [L] RewriteCond %{REQUEST_URI} favicon.ico$ RewriteCond ^(.+)favicon.ico !-f RewriteRule ^(.*)$ /misc/favicon.ico [L] RewriteCond %{REQUEST_URI} robots.txt$ RewriteCond ^(.+)robots.txt !-f RewriteRule ^(.*)$ /misc/robots.txt [L]

    Read the article

  • Using Url Rewrite to Block Page Requests

    - by The Official Microsoft IIS Site
    The other day I was checking the traffic stats for my WordPress blog to see which of my posts were the most popular. I was a little concerned to see that wp-login.php was in the Top 5 total requests almost every month. Since I’m the only author on my blog my logins could not possibly account for the traffic hitting that page. The only explanation could be that the additional traffic was coming from automated hacking attempts. Any server administrator concerned about security knows that “ footprinting...(read more)

    Read the article

  • .htaccess ReWrite wildcard folder paths from host

    - by JHuangweb
    My desired result is change a file to root / from a N number of paths. For example: www.host.com/a/b/c/e/f/g/images/1.jpg, where A~G is not always given. Result: www.host.com/images/1.jpg This is what I have so far: www.host.com/a/images -- www.host.com/images Using: RewriteRule ^a\/images/$ images/$1 [L] What I need is a wildcard in front of /images/ Like this: RewriteRule ^*/images/$ images/$1 [L] How can I do this correctly in .htaccess?

    Read the article

  • Rewrite a URL that's already been redirected?

    - by Jack
    Hi guys, I'm running an Apache2 web server with a dynamic IP address. I bought exampledomain.net, and I use no-ip.com's domain-update service to redirect any visitors to my current ip address (endnote #1). For example, someone visits exampledomain.net and they get redirected to 73.181.57.34. It works like a charm. However, it isn't all that user-friendly. Can I rewrite the redirected, ip-address URL? I tried these rewrite rules in the root folder's .htaccess... RewriteEngine On RewriteCond %{HTTP_HOST} ^73\.181\.57\.34:88 RewriteRule ^(.*)$ http://www.exampledomain.net/$1 [L,NC] # I simplified the RewriteCond. I would use regex in a real situation. Of course, this creates an infinite loop. The user visits www.exampledomain.net. They're redirected to 73.181.57.34:88 by no-ip. Apache redirects them to www.exampledomain.net which redirects them back to 73.181.57.34:88... so on and so forth. I'm a noob when it comes to rewriting, but is there a way to rewrite a URL without redirecting? I tried these rewrite rules too (a shot in the dark)... RewriteEngine On RewriteCond %{HTTP_HOST} ^73\.181\.57\.34:88 RewriteRule ^(.*)$ my.exampledomain.net/$1 [L,NC] # I'd read that Apache replied with a redirect header when you include http Thanks! (1) No-IP works like this: You download and install their dynamic update client on your server. Every couple of minutes it polls your server for its current external ip address. If it's changed, it updates your server's ip address in no-ip's records.

    Read the article

  • htaccess Rewrite Rule duplicate - help me out please / RewriteRule ^(.*)\+apple\+fruit/$ ?q=$1 [L]

    - by elmaso
    Hello, I have this code in my .htaccess: Options +FollowSymLinks RewriteEngine On RewriteBase / RewriteRule ^(.*)\+apple\+fruit/$ ?q=$1 [L] this turns the searchquery in /keyword+apple+fruit/ thats ok.. the only problem is, if I type in /keyword+apple+fruit +any+text+haha+ apple+fruit/ the htacces is showing content - but I don't want that. is there any command to say - ok apple + fruit only one time in the url and the second time send a 404 or show nothing.. thank you!!

    Read the article

  • ReWrite Rules Issue

    - by Jacob Clark
    I seem to be having an issue with my Apache Rewrites RewriteEngine on RewriteBase / RewriteRule ^wordpress/?$ / [NC,L,R=301] RewriteRule ^/$ wordpress/ [NC,L] I simply need to remove /wordpress from the URL as I have pages within Wordpress I want to be seen as the main directory At the moment the urls are domain.com/wordpress/blog I'd rather not have /wordpress, rather domain.com/blog Any help?

    Read the article

  • Where does the URL parameter "?chocaid=397" come from?

    - by unor
    In Google Webmaster Tools, I noticed that my front page was indexed two times: example.com/ example.com/?chocaid=397 I know that I could fix this with the use of link type canonical, but I wonder: Where does this parameter come from? There are various sites that have pages indexed with this very parameter/value: https://duckduckgo.com/?q=chocaid%3D397. I looked for similarities between these sites. but couldn't find a conclusive one: It's often the front page, but not in every case. Some are NSFW, but not all. When one domains' URL has this parameter, often other subdomains of the same domain have it, too. Examples Wikipedia entry Microsoft Codeplex

    Read the article

  • Need some help on tomcat URL mod_rewrite or mod_jk

    - by Redbull Fan
    I am trying to remove the context name from the url of my server. Current URL - http://www.domainname.com/MyApp/ What I need to make is to make it avaialble at - www.domainname.com/ So it is only going to host one main app and that needs to be displayed when we open www.domainname.com/ on browser. I have already tried couple of things like below - RewriteEngine On RewriteCond %{REQUEST_URI} !^/(Context/.*)$ RewriteRule ^/(.*)$ /Context/$1 [P,L] OR redirect permanent /MyApp/ abcd://domainname.com OR Using JKMount - JkMount /MyApp/* ajp13 JkMount /MyApp* ajp13 OR Deploy war file to ROOT of tomcat and make relevant chagnes in web and server.xml All of these aren't working and I keep getting a intenal error. I need a way to basically trim the tomcat URL to make short. Thanks, Andy

    Read the article

  • Need some help on tomcat URL mod_rewrite or mod_jk

    - by Redbull Fan
    I am trying to remove the context name from the url of my server. Current URL - http://www.domainname.com/MyApp/ What I need to make is to make it avaialble at - www.domainname.com/ So it is only going to host one main app and that needs to be displayed when we open www.domainname.com/ on browser. I have already tried couple of things like below - RewriteEngine On RewriteCond %{REQUEST_URI} !^/(Context/.*)$ RewriteRule ^/(.*)$ /Context/$1 [P,L] OR redirect permanent /MyApp/ abcd://domainname.com OR Using JKMount - JkMount /MyApp/* ajp13 JkMount /MyApp* ajp13 OR Deploy war file to ROOT of tomcat and make relevant chagnes in web and server.xml All of these aren't working and I keep getting a intenal error. I need a way to basically trim the tomcat URL to make short. Thanks, Andy

    Read the article

  • converting apache rewrite rules to nginx for xenforo

    - by nick
    Hi all, I am migrating some forums from vbulletin 3.8.x to xenforo, and trying to keep my old link structure alive. Basically, XF provides some php files that I can redirect the old url style to and it handles the proper 301 redirection. Regardless of that end, I am having difficulty rewriting the rules which I can only find defined in apache's rewrite style: RewriteRule [\d]+-[^/]+/.+-([\d]+)/([\d]+)/ showthread.php?t=$1&page=$2 [NC,L] RewriteRule [\d]+-[^/]+/.+-([\d]+)/ showthread.php?t=$1 [NC,L] RewriteRule ([\d]+)-[^/]+/([\d]+)/ forumdisplay.php?f=$1&page=$2 [NC,L] RewriteRule ([\d]+)-[^/]+/ forumdisplay.php?f=$1 [NC,L] I have been experimenting and thought this should work, but obviously not: if (!-e $request_filename) { rewrite [0-9a-zA-Z\-]/[0-9a-zA-Z\-]-([0-9])/([0-9])/ /showthread.php?t=$1&page=$2 last; rewrite [0-9a-zA-Z\-]/[0-9a-zA-Z\-]-([0-9])/ /showthread.php?t=$1 last; rewrite ([0-9])-[0-9a-zA-Z\-]/([0-9])/ /forumdisplay.php?f=$1&page=$2 last; rewrite ([0-9])-[0-9a-zA-Z\-]/ /forumdisplay.php?f=$1 last; rewrite ^(.*)$ /index.php last; } old vB showthread format: website.tld/233-website-issues-requests/wiki-down-73789/ new XF showthread format: website.tld/threads/the-wiki-is-down.65509/ old vB forumdisplay format: website.tld/233-website-issues-requests/ new XF forumdisplay format: website.tld/forums/website-issues-and-requests.253/

    Read the article

  • IIRF redirect combine rules?

    - by Phill
    I have 3 "rules". One to make sure URLs are lowercase another to include a slash at the end of directories, and a 3rd to force access to index.html pages to be thru the directory instead. The problem w/ how I have it is, sometimes this is causing multiple 301 redirects. I'd really like each rule to apply in turn and then if neccessary redirect once to the final url. For example a url might need to be converted to lowercase and have a slash added. Or may need to be lowecase and change from index.html to a directory. Any ideas how I can do this? Thanks very much. The rules are below: #LOWERCASE URLS For Directories, aspx, html files RedirectRule ^/(.*[A-Z].*(/|\.html|\.aspx))$ /#L$1#E [R=301] #ADD SLASH TO DIRECTORIES #--------------------------------------------- #Perm Redirect If: #Starts w/ Forward Slash #Match Any Characters Except (. or ?) 1 or more times #End w/ someting besides a dot, ?, or slash #If So, Perm Redirect captured piece W/ Slash At End and at front RedirectRule ^/([^.?]+[^.?/])$ /$1/ [I,R=301] #CHANGE INDEX.HTML REQUESTS TO DIRECTORY REQUESTS #--------------------------------------------- RedirectRule ^/(.*)/index\.html$ /$1/ [I,R=301]

    Read the article

  • Apply rewrite rule for all but all the files (recursive) in a subdirectory?

    - by user784637
    I have an .htaccess file in the root of the website that looks like this RewriteRule ^some-blog-post-title/ http://website/read/flowers/a-new-title-for-this-post/ [R=301,L] RewriteRule ^some-blog-post-title2/ http://website/read/flowers/a-new-title-for-this-post2/ [R=301,L] <IfModule mod_rewrite.c> RewriteEngine On ## Redirects for all pages except for files in wp-content to website/read RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} !/wp-content RewriteRule ^(.*)$ http://website/read/$1 [L,QSA] #RewriteRule ^http://website/read [R=301,L] RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> My intent is to redirect people to the new blog post location if they propose one of those special blog posts. If that's not the case then they should be redirected to http://website.com/read. Nothing from http://website.com/wp-content/* should be redirected. So far conditions 1 and 3 are being met. How can I meet condition 2?

    Read the article

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