Search Results

Search found 5416 results on 217 pages for 'urls py'.

Page 14/217 | < Previous Page | 10 11 12 13 14 15 16 17 18 19 20 21  | Next Page >

  • htaccess querystring based urls

    - by praveenmon
    hi guys, Suppose my website is www.example.com Earlier the urls of my website was like this www.example.com/php/bookdetails.php?bid=33 Last week i changed the urls of my site to this www.example.com/bookdetails/33 and wrote an htacces like this RewriteRule ^bookdetails/(.*)$ php/bookSearchResult.php?bid=$1 The problem is that there are some external site using my earlier URL structure (www.example.com/php/bookdetails.php?bid=33) and what i want is to redirect it to my new URL structure (www.example.com/bookdetails/33). I know it can be possible in htaccess, but i have no idea how to do it

    Read the article

  • Rewrite only URLs that don't exist

    - by PeterBelm
    I'm looking for a way to rewrite URLs only if the path doesn't exist. This isn't to handle 404s, but to redirect page URLs to a shared PHP file (ie: '/contact-us/' - '/show_page.php?page=contact-us'). The basic redirect is easy enough to achieve, however I want to be able to override the default page by adding '/contact-us/index.php' in the site root. Is this achievable with mod_rewrite or would I have to do something else?

    Read the article

  • Multiple URLs Single Server

    - by Amit
    Hi, In the DNS I have setup multiple URLs for my website (all pointing to same server). The entries in DNS looks like as below: Host TTL Numeric IP www .mysite.net 7200 192.168.31.12 @ (None) .mysite.net 7200 192.168.31.12 mycompany .mysite.net 7200 192.168.31.12 I wrote a code on Login.aspx page to check the URL and navigate to appropriate company login page. So if I type www.mysite.net or mysite.net then I am getting navigated to standard login page. But when I type mycompany.mysite.net still I am getting navigated to standard login page. But when I type https://mycompany.mysite.net then I am getting navigated to company specific login page. Why I need to type complete URL with https to get navigated to compay specific login page? Why it is not working just with mycompany.mysite.net? Any help of this is highly appriciated. Thanks, Amit

    Read the article

  • PHP: Extensionless URLs in IIS7 (windows)? (for wordpress)

    - by smithym
    Hi there, I have recently installed wordpress but i would like to configure extensionless URLs .. I am using IIS7 but on a shared server. I presume i cna add something to web.config file?? I am little bit confused, in IIS7 and asp.net mvc it is done via code... but in PHP i don't think it is .... so the only alternative is to use a re-write module but i can't as I am on a shared server and can't install ISAPI stuff.. so I was wondering if there is a way to do the mapping i.e. when going to testme it would actually load testme.php Any advise really appreciated Thanks

    Read the article

  • Nginx Rewrite rules for clean URLs

    - by Sujay
    I want to write nginx rewrite rules for clean URLs. Everytime the user hits http://domain.com/abc/12/16/abc-def-ghi I need to execute domain.com/abc.php?a=12&b=16&c=abc-def-ghi. Now my regex is right as per rubular: ^\/abc\/(\d+)\/(\d+)\/(\w+\S+)$ http://rubular.com/regexes/11063 and rule is if (!-e $request_filename) { rewrite ^\/abc\/(\d+)\/(\d+)\/(\w+\S+)$ abc.php?a=$1&b=$2&c=$3 last; } But it is giving "No input File specified". I cant find what the problem is?

    Read the article

  • Nginx Rewrite rules for clean URLs

    - by Sujay
    I want to write nginx rewrite rules for clean URLs. Everytime the user hits http://domain.com/abc/12/16/abc-def-ghi I need to execute domain.com/abc.php?a=12&b=16&c=abc-def-ghi. Now my regex is right as per rubular: ^\/abc\/(\d+)\/(\d+)\/(\w+\S+)$ http://rubular.com/regexes/11063 and rule is if (!-e $request_filename) { rewrite ^\/abc\/(\d+)\/(\d+)\/(\w+\S+)$ abc.php?a=$1&b=$2&c=$3 last; } But it is giving "No input File specified". I cant find what the problem is?

    Read the article

  • force all urls to www and force domain to non-www

    - by Digital site
    I was trying to force my domain to redirect without www and could success through this code: .htaccess: RewriteCond %{HTTP_HOST} ^www\.domain\.com [NC] RewriteRule ^(.*) http://domain.com/$1 [R=301,L] however, this code is going to redirect all www to non-www, which is not what I want. I just want to make the main domain from www.mydomain.com to mydomain.com and the rest of the urls should be forced to www. any idea how to add or modify the code so I can achieve that through .htaccess ? Update: Thanks to all. I found out that swf file from piecemaker was corrupted and updated it with new one. so now it is all fine and works on both www and non-www. I'm still curious how to solve this issue anyways using .htaccess. Thanks again.

    Read the article

  • Drupal + Lighttpd: enabling clean urls (rewriting)

    - by Patrick
    I'm emulating Ubuntu on my mac, and I use it as a server. I've installed lighttpd + Drupal and the following configuration section requires a domain name in order to make clean urls to work. Since I'm using a local server I don't have a domain name and I was wondering how to make it work given the fact the ip of the local machine is usually changing. thanks $HTTP["host"] =~ "(^|\.)mywebsite\.com" { server.document-root = "/var/www/sites/mywebsite" server.errorlog = "/var/log/lighttpd/mywebsite/error.log" server.name = "mywebsite.com" accesslog.filename = "/var/log/lighttpd/mywebsite/access.log" include_shell "./drupal-lua-conf.sh mywebsite.com" url.access-deny += ( "~", ".inc", ".engine", ".install", ".info", ".module", ".sh", "sql", ".theme", ".tpl.php", ".xtmpl", "Entries", "Repository", "Root" ) # "Fix" for Drupal SA-2006-006, requires lighttpd 1.4.13 or above # Only serve .php files of the drupal base directory $HTTP["url"] =~ "^/.*/.*\.php$" { fastcgi.server = () url.access-deny = ("") } magnet.attract-physical-path-to = ("/etc/lighttpd/drupal-lua-scripts/p-.lua") }

    Read the article

  • Using gitlab behind Apache proxy all urls are wrong

    - by Hippyjim
    I've set up Gitlab on Ubuntu 12.04 using the default package from https://about.gitlab.com/downloads/ As I had Apache installed already I have to run nginx on localhost:8888. The problem is, all images (such as avatars) are now served from that url, and all the checkout urls Gitlab gives are also the same - instead of using my domain name. If I change /etc/gitlab/gitlab.rb to use that url, then Gitlab stops working and gives a 503. Any ideas how I can tell Gitlab what URL to present to the world, even though it's really running on localhost? /etc/gitlab/gitlab.rb looks like: # Change the external_url to the address your users will type in their browser external_url 'http://my.local.domain' redis['port'] = 6379 postgresql['port'] = 2345 unicorn['port'] = 3456 and /opt/gitlab/embedded/conf/nginx.conf looks like: server { listen localhost:8888; server_name my.local.domain;

    Read the article

  • Prevent URLs from specific domains from being saved in Firefox history

    - by noam
    I want to prevent or block URLs of specific domains from being saved or shown in my history. I want to be able to go to these certain websites normally, just not have them saved and not have to use private or incognito mode. For instance, I don't want any of Google's search result pages to be saved in my history since then when I use the awesomebar I get a lot of Google's search results, which are of no use to me. Of course I can keep on deleting them, but I would like a way to specify that any URL starting with www.google.com shouldn't be saved.

    Read the article

  • Configuring weblogic server console with external server urls, etc

    - by MeBigFatGuy
    there are obviously various 'canned' configuration options in oracle's weblogic server console for setting up data sources, jms queues, ldap servers etc, etc. What i want however is a way to configure other servers, mostly server urls, etc, in the console as well, and allow web applications running on the web server to access those configuration settings at runtime, probably through jndi names. Things like a document management server, a workflow server, etc. However I'm at a loss for how to configure custom jndi 'data sources' within wls' console. Is this possible?

    Read the article

  • Apache resolves all URLs to default

    - by Ariel
    I am using Apache 2.2 on a Debian-based distro. For some reason, all URLs are directed to the default index. No error or anything. That means: example.domain.com goes to domain.com. "example" can be just anything. In the default Vhost file (/etc/apache2/sites-available/default) I've added: ServerName: www.domain.com But it still keeps that odd behaviour. Please let me know how to enable the common, default behaviour. I haven't changed anything by the way, this is since installation. Update: Following SvW's answer, I am looking for a way to force Apache not to accept any URL, only those specified as VirtualHosts.

    Read the article

  • Overriding the save() method of a model that uses django-mptt

    - by saturdayplace
    I've been using django-mptt in my project for a while now, it's fabulous. Recently, I've found a need to override a model's save() method that uses mptt, and I'm getting an error when I try to save a new instance of that model: Exception Type: ValueError at /admin/scrivener/page/add/ Exception Value: Cannot use None as a query value I'm assuming that this is a result of the fact that the instance hasn't been stuck into a tree yet, but I'm not sure how to go about fixing this. I added a comment about it onto a similar issue on the project's tracker, but I was hoping that someone here might be able to put me on the right track faster. Here's the traceback. Environment: Request Method: POST Request URL: http://localhost:8000/admin/scrivener/page/add/ Django Version: 1.2 rc 1 SVN-13117 Python Version: 2.6.4 Installed Applications: ['django.contrib.auth', 'django.contrib.contenttypes', 'django.contrib.sessions', 'django.contrib.sites', 'django.contrib.admin', 'django.contrib.sitemaps', 'mptt', 'filebrowser', 'south', 'haystack', 'django_static', 'etc', 'scrivener', 'gregor', 'annunciator'] Installed Middleware: ('django.middleware.common.CommonMiddleware', 'django.contrib.sessions.middleware.SessionMiddleware', 'django.contrib.auth.middleware.AuthenticationMiddleware') Traceback: File "B:\django-apps\3rd Party Source\django\core\handlers\base.py" in get_response 100. response = callback(request, *callback_args, **callback_kwargs) File "B:\django-apps\3rd Party Source\django\contrib\admin\options.py" in wrapper 239. return self.admin_site.admin_view(view)(*args, **kwargs) File "B:\django-apps\3rd Party Source\django\utils\decorators.py" in _wrapped_view 74. response = view_func(request, *args, **kwargs) File "B:\django-apps\3rd Party Source\django\views\decorators\cache.py" in _wrapped_view_func 69. response = view_func(request, *args, **kwargs) File "B:\django-apps\3rd Party Source\django\contrib\admin\sites.py" in inner 190. return view(request, *args, **kwargs) File "B:\django-apps\3rd Party Source\django\utils\decorators.py" in _wrapper 21. return decorator(bound_func)(*args, **kwargs) File "B:\django-apps\3rd Party Source\django\utils\decorators.py" in _wrapped_view 74. response = view_func(request, *args, **kwargs) File "B:\django-apps\3rd Party Source\django\utils\decorators.py" in bound_func 17. return func(self, *args2, **kwargs2) File "B:\django-apps\3rd Party Source\django\db\transaction.py" in _commit_on_success 299. res = func(*args, **kw) File "B:\django-apps\3rd Party Source\django\contrib\admin\options.py" in add_view 795. self.save_model(request, new_object, form, change=False) File "B:\django-apps\3rd Party Source\django\contrib\admin\options.py" in save_model 597. obj.save() File "B:\django-apps\scrivener\models.py" in save 205. self.url = self.get_absolute_url() File "B:\django-apps\3rd Party Source\django\utils\functional.py" in _curried 55. return _curried_func(*(args+moreargs), **dict(kwargs, **morekwargs)) File "B:\django-apps\3rd Party Source\django\db\models\base.py" in get_absolute_url 940. return settings.ABSOLUTE_URL_OVERRIDES.get('%s.%s' % (opts.app_label, opts.module_name), func)(self, *args, **kwargs) File "B:\django-apps\3rd Party Source\django\db\models\__init__.py" in inner 31. bits = func(*args, **kwargs) File "B:\django-apps\scrivener\models.py" in get_absolute_url 194. for ancestor in self.get_ancestors(): File "B:\django-apps\3rd Party Source\mptt\models.py" in get_ancestors 23. opts.tree_id_attr: getattr(self, opts.tree_id_attr), File "B:\django-apps\3rd Party Source\django\db\models\manager.py" in filter 141. return self.get_query_set().filter(*args, **kwargs) File "B:\django-apps\3rd Party Source\django\db\models\query.py" in filter 550. return self._filter_or_exclude(False, *args, **kwargs) File "B:\django-apps\3rd Party Source\django\db\models\query.py" in _filter_or_exclude 568. clone.query.add_q(Q(*args, **kwargs)) File "B:\django-apps\3rd Party Source\django\db\models\sql\query.py" in add_q 1131. can_reuse=used_aliases) File "B:\django-apps\3rd Party Source\django\db\models\sql\query.py" in add_filter 1000. raise ValueError("Cannot use None as a query value") Exception Type: ValueError at /admin/scrivener/page/add/ Exception Value: Cannot use None as a query value

    Read the article

  • When i trid to install ubuntu 11.10 i get an error '"Windows Backend object has no attribute 'iso-path' - see log for details.'

    - by Raja
    I am trying to install Ubuntu 11.10 in windows XP, Everything went as before until the countdown clock reached zero, then I got "Windows Backend object has no attribute 'iso-path' - see log for details. It's done it three times now. (Formatting in between) The end of the log says 11-01 17:20 DEBUG TaskList: New task check_iso 11-01 17:20 DEBUG TaskList: ### Running check_iso... 11-01 17:20 DEBUG CommonBackend: Checking Y:\ubuntu\install\installation.iso 11-01 17:20 DEBUG Distro: checking Ubuntu ISO Y:\ubuntu\install\installation.iso 11-01 17:20 DEBUG Distro: wrong size: 8094031872 900000000 11-01 17:20 DEBUG TaskList: ### Finished check_iso 11-01 17:20 ERROR TaskList: 'WindowsBackend' object has no attribute 'iso_path' Traceback (most recent call last): File "\lib\wubi\backends\common\tasklist.py", line 197, in call File "\lib\wubi\backends\common\backend.py", line 579, in get_iso File "\lib\wubi\backends\common\backend.py", line 565, in use_iso AttributeError: 'WindowsBackend' object has no attribute 'iso_path' 11-01 17:20 DEBUG TaskList: # Cancelling tasklist 11-01 17:20 DEBUG TaskList: # Finished tasklist 11-01 17:20 ERROR root: 'WindowsBackend' object has no attribute 'iso_path' Traceback (most recent call last): File "\lib\wubi\application.py", line 58, in run File "\lib\wubi\application.py", line 130, in select_task File "\lib\wubi\application.py", line 205, in run_cd_menu File "\lib\wubi\application.py", line 120, in select_task File "\lib\wubi\application.py", line 158, in run_installer File "\lib\wubi\backends\common\tasklist.py", line 197, in call File "\lib\wubi\backends\common\backend.py", line 579, in get_iso File "\lib\wubi\backends\common\backend.py", line 565, in use_iso AttributeError: 'WindowsBackend' object has no attribute 'iso_path'

    Read the article

  • '"Windows Backend object has no attribute 'iso-path' - see log for details.' error when trying to install

    - by Raja
    I am trying to install Ubuntu 11.10 in windows XP, Everything went as before until the countdown clock reached zero, then I got "Windows Backend object has no attribute 'iso-path' - see log for details. It's done it three times now. (Formatting in between) The end of the log says ====== 11-01 17:20 DEBUG TaskList: New task check_iso 11-01 17:20 DEBUG TaskList: ### Running check_iso... 11-01 17:20 DEBUG CommonBackend: Checking Y:\ubuntu\install\installation.iso 11-01 17:20 DEBUG Distro: checking Ubuntu ISO Y:\ubuntu\install\installation.iso 11-01 17:20 DEBUG Distro: wrong size: 8094031872 > 900000000 11-01 17:20 DEBUG TaskList: ### Finished check_iso 11-01 17:20 ERROR TaskList: 'WindowsBackend' object has no attribute 'iso_path' Traceback (most recent call last): File "\lib\wubi\backends\common\tasklist.py", line 197, in __call__ File "\lib\wubi\backends\common\backend.py", line 579, in get_iso File "\lib\wubi\backends\common\backend.py", line 565, in use_iso AttributeError: 'WindowsBackend' object has no attribute 'iso_path' 11-01 17:20 DEBUG TaskList: # Cancelling tasklist 11-01 17:20 DEBUG TaskList: # Finished tasklist 11-01 17:20 ERROR root: 'WindowsBackend' object has no attribute 'iso_path' Traceback (most recent call last): File "\lib\wubi\application.py", line 58, in run File "\lib\wubi\application.py", line 130, in select_task File "\lib\wubi\application.py", line 205, in run_cd_menu File "\lib\wubi\application.py", line 120, in select_task File "\lib\wubi\application.py", line 158, in run_installer File "\lib\wubi\backends\common\tasklist.py", line 197, in __call__ File "\lib\wubi\backends\common\backend.py", line 579, in get_iso File "\lib\wubi\backends\common\backend.py", line 565, in use_iso AttributeError: 'WindowsBackend' object has no attribute 'iso_path'

    Read the article

  • Django url parameters

    - by Hulk
    How to pass two paramters in urls in django <script> url=/toolbox/display/" + id + "2"; window.location=url; </script> Also how is this handeled in urls.py (r'^display/(?P<rid>\d+)/(?P<param>\d+)/$', 'table_display'), In views, def table_display(request,rid,param): print param //This should print 2

    Read the article

  • Creating Signed URLs for Amazon CloudFront

    - by Zack
    Short version: How do I make signed URLs "on-demand" to mimic Nginx's X-Accel-Redirect behavior (i.e. protecting downloads) with Amazon CloudFront/S3 using Python. I've got a Django server up and running with an Nginx front-end. I've been getting hammered with requests to it and recently had to install it as a Tornado WSGI application to prevent it from crashing in FastCGI mode. Now I'm having an issue with my server getting bogged down (i.e. most of its bandwidth is being used up) due to too many requests for media being made to it, I've been looking into CDNs and I believe Amazon CloudFront/S3 would be the proper solution for me. I've been using Nginx's X-Accel-Redirect header to protect the files from unauthorized downloading, but I don't have that ability with CloudFront/S3--however they do offer signed URLs. I'm no Python expert by far and definitely don't know how to create a Signed URL properly, so I was hoping someone would have a link for how to make these URLs "on-demand" or would be willing to explain how to here, it would be greatly appreciated. Also, is this the proper solution, even? I'm not too familiar with CDNs, is there a CDN that would be better suited for this?

    Read the article

  • ASP.Net MVC: "Random" URLs getting generated by URL.Action

    - by Daniel Magliola
    I have 2 very similar routes, just because i'm trying to generate two different URLs for the same resource (same Controller/Action), and both are very similar. These are the routes definitions: routes.MapRoute("Post2.Mp3", "sites/{siteSlug}/post/{brand}/aconstant-{slug}.mp3", new { controller = "Posts", action = "Mp3" }, new { siteSlug = @"[A-Za-z0-9-_]+", slug = @"[^(aconstant\-)][A-Za-z0-9-_]+", brand = @"[A-Za-z0-9-_]+" }); routes.MapRoute("Post.Mp3", "sites/{siteSlug}/post/{slug}.mp3", new { controller = "Posts", action = "Mp3" }, new { siteSlug = @"[A-Za-z0-9-_]+", slug = @"[A-Za-z0-9-_]+" }); "brand" is going to be my site name, which is the same as "aconstant" in those routes. Now, if I try this: Url.Action("ShowMp3", "Posts", new { siteSlug = post.Site.Slug, slug = post.Slug, origin = "origfeedwithaudio", brand = "aconstant" }) sometimes I get the URL I expect: /sites/site-Name/post/aconstant/aconstant-post-Name.mp3 but sometimes, I get this: /sites/site-Name/post/post-Name.mp3?brand=aconstant By sometimes, I mean that different sets of "slugs" give me one or the other. I haven't seen the same set of slugs give me different URLs. I haven't found any reasonable rule for when i'm getting one or the other, it seems random. What is going on here? How can I be getting different URLs based on esentially the same arguments? Thanks! Daniel

    Read the article

  • Django Class Views and Reverse Urls

    - by kalhartt
    I have a good many class based views that use reverse(name, args) to find urls and pass this to templates. However, the problem is class based views must be instantiated before urlpatterns can be defined. This means the class is instantiated while urlpatterns is empty leading to reverse throwing errors. I've been working around this by passing lambda: reverse(name, args) to my templates but surely there is a better solution. As a simple example the following fails with exception: ImproperlyConfigured at xxxx The included urlconf mysite.urls doesn't have any patterns in it mysite.urls from mysite.views import MyClassView urlpatterns = patterns('', url(r'^$' MyClassView.as_view(), name='home') ) views.py class MyClassView(View): def get(self, request): home_url = reverse('home') return render_to_response('home.html', {'home_url':home_url}, context_instance=RequestContext(request)) home.html <p><a href={{ home_url }}>Home</a></p> I'm currently working around the problem by forcing reverse to run on template rendering by changing views.py to class MyClassView(View): def get(self, request): home_url = lambda: reverse('home') return render_to_response('home.html', {'home_url':home_url}, context_instance=RequestContext(request)) and it works, but this is really ugly and surely there is a better way. So is there a way to use reverse in class based views but avoid the cyclic dependency of urlpatterns requiring view requiring reverse requiring urlpatterns...

    Read the article

  • Issue with IHttpHandler and relative URLs

    - by vtortola
    Hi, I've developed a IHttpHandler class and I've configured it as verb="*" path="*", so I'm handling all the request with it in an attempt of create my own REST implementation for a test web site that generates the html dynamically. So, when a request for a .css file arrives, I've to do something like context.Response.WriteFile(Server.MapPath(url)) ... same for pictures and so on, I have to response everything myself. My main issue, is when I put relative URLs in the anchors; for example, I have main page with a link like this <a href="page1">Go to Page 1</a> , and in Page 1 I have another link <a href="page2">Go to Page 2</a>. Page 1 and 2 are supposed to be at the same level (http://host/page1 and http://host/page2, but when I click in Go to Page 2, I got this url in the handler: ~/page1/~/page2 ... what is a pain, because I have to do an url = url.SubString(url.LastIndexOf('~')) for clean it, although I feel that there is nothing wrong and this behavior is totally normal. Right now, I can cope with it, but I think that in the future this is gonna bring me some headache. I've tried to set all the links with absolute URLs using the information of context.Request.Url, but it's also a pain :D, so I'd like to know if there is a nicer way to do these kind of things. Don't hesitate in giving me pretty obvious responses because I'm pretty new in web development and probably I'm skipping something basic about URLs, Http and so on. Thanks in advance and kind regards.

    Read the article

  • Django: Named URLs / Same Template, Different Named URL

    - by TheLizardKing
    I have a webapp that lists all of my artists, albums and songs when the appropriate link is clicked. I make extensive use of generic views (object_list/detail) and named urls but I am coming across an annoyance. I have three templates that pretty much output the exact same html that look just like this: {% extends "base.html" %} {% block content %} <div id="content"> <ul id="starts-with"> {% for starts_with in starts_with_list %} <li><a href="{% url song_list_x starts_with %}">{{ starts_with|upper }}</a></li> {% endfor %} </ul> <ul> {% for song in songs_list %} <li>{{ song.title }}</li> {% endfor %} </ul> </div> {% endblock content %} My artist and album template look pretty much the same and I'd like to combine the three template's into one. The fact that my variables start with song can easily be changed to the default obj. It's my <ul id="starts-with"> named url I don't know how to correct. Obviously I want it to link to a specific album/artist/song using the named urls in my urls.py but I don't know how to make it context aware. Any suggestions? urlpatterns = patterns('tlkmusic.apps.tlkmusic_base.views', # (r'^$', index), url(r'^artists/$', artist_list, name='artist_list'), url(r'^artists/(?P<starts_with>\w)/$', artist_list, name='artist_list_x'), url(r'^artist/(?P<artist_id>\d+)/$', artist_detail, name='artist_detail'), url(r'^albums/$', album_list, name='album_list'), url(r'^albums/(?P<starts_with>\w)/$', album_list, name='album_list_x'), url(r'^songs/$', song_list, name='song_list'), url(r'^songs/(?P<starts_with>\w)/$', song_list, name='song_list_x'), )

    Read the article

  • What should the standard be for ReSTful URLS?

    - by gargantaun
    Since I can't find a chuffing job, I've been reading up on ReST and creating web services. The way I've interpreted it, the future is all about creating a web service for all your data before you build the web app. Which seems like a good idea. However, there seems to be a lot of contradictory thoughts on what the best scheme is for ReSTful URLs. Some people advocate simple pretty urls http://api.myapp.com/resource/1 In addition, some people like to add the API version to the url like so http://api.myapp.com/v1/resource/1 And to make things even more confusing, some people advocate adding the content-type to get requests http://api.myapp.com/v1/resource/1.xml http://api.myapp.com/v1/resource/1.json http://api.myapp.com/v1/resource/1.txt Whereas others think the content-type should be sent in the HTTP header. Soooooooo.... That's a lot of variation, which has left me unsure of what the best URL scheme is. I personally see the merits of the most comprehensive URL that includes a version number, resource locator and content-type, but I'm new to this so I could be wrong. On the other hand, you could argue that you should do "whatever works best for you". But that doesn't really fit with the ReST mentality as far as I can tell since the aim is to have a standard. And since a lot of you people will have more experience than me with ReST, I thought I'd ask for some guidance. So, with all that in mind... What should the standard be for ReSTful URLS?

    Read the article

  • MAMP Pro .xip.io, fixing urls with htaccess

    - by user3540018
    I've got all my websites set up with MAMP Pro. For instance, I got it set up, so when I go to example.com, the browser displays the website that's set up on my iMac. Now, I wanna get MAMP Pro to work so I can view my website on my other computers/devices (which are all hooked up on the same network.) So far all I had to do is check the checkbox "via Xip.io (LAN only)", and now I can view my website on my other computers/devices within my LAN by simply going to example.com.10.0.1.13.xip.io. Problem is, whenever I'm on this other computer/device, when I click on the links, I get 404 error. ie. whenever I go to example.com/news, I get the 404. But when I go to example.com.10.0.1.13.xip.io/news, THEN I get the right page. So in order to solve my problem I need to rewrite the urls. So whenever someone clicks on a link ie. goes straight to example.com/news, he'll go to example.com.10.0.1.13.xip.io/news. I don't want to change all the links in my MySQL file, but I believe I can do it simply with the htaccess file. I've opened the htaccess file and added the last two lines, but it just doesn't work. <IfModule mod_rewrite.c> RewriteEngine On # Send would-be 404 requests to Craft RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} !^/(favicon\.ico|apple-touch-icon.*\.png)$ [NC] RewriteRule (.+) index.php?p=$1 [QSA,L] RewriteCond %{HTTP_HOST} ^example\.com RewriteRule ^(.*)$ http://www.example.com.10.0.1.13.xip.io/$1 [R=permanent,L] </IfModule> Or perhaps I don't need to change the htaccess file, is there something that I could be missing in the MAMP Pro settings, or perhaps a MAMP extension that I need?

    Read the article

  • NGINX rewrite for vanity URLs when file doesn't exist (try_files and rewrite together)

    - by user1721724
    I'm trying to get vanity URLs on my server. If the file path from the URL doesn't exist, I want to rewrite the URL to profile.php, but if my users have periods in their usernames, their vanity URL doesn't work. Here is my conf block. server { listen 80; server_name www.example.com; rewrite ^/([a-zA-Z0-9-_]+)$ /profile.php?url=$1 last; root /var/www/html/example.com; error_page 404 = /404.php; location ~* \.(js|css|png|jpg|jpeg|gif|ico)$ { expires 1y; log_not_found off; } location ~ \.php$ { fastcgi_pass example_fast_cgi; fastcgi_index index.php; fastcgi_param SCRIPT_FILENAME /var/www/html/example.com$fastcgi_script_name; include fastcgi_params; } location / { index index.php index.html index.htm; } location ~ /\.ht { deny all; } location /404.php { internal; return 404; } } Any help would be appreciated. Thanks!

    Read the article

< Previous Page | 10 11 12 13 14 15 16 17 18 19 20 21  | Next Page >