url-rewriting

Server.Transfer vs. Context.RewritePath

别来无恙 提交于 2019-12-21 03:40:21
问题 I understand they both don't change the URL that the client sees. Is there anything in them that makes one of them preferable over the other? I'm planning to use it in the Application_BeginRequest in Global.asax, but also in regular aspx page. 回答1: I think Context.RewritePath() is the better option. Reason: Server.Transfer() throws a ThreadAbortException every time. The result of calling Response.End() . For more details read the following MS articles: ThreadAbortException Occurs If You Use

URL rewriting for Magento module

对着背影说爱祢 提交于 2019-12-21 02:46:07
问题 I have created a New Module in Magento and named it as "article". It has two Front end controllers index and article. And in the article controller i have an action called "archives" to list the articles on the front end / website based on the archives. Everything is fine except the URL. The Working URL right now is : [http://]mydemostore/article/article/archives/01/2011 What i actually need is http://mydemostore/article/archives/01/2011 I don't want to have an extra "article" (the controller

Do HTTP authentication over HTTPS with URL rewriting

好久不见. 提交于 2019-12-20 23:24:22
问题 I am trying to protect the ~/public_html/dev directory using http auth basic, but to make that secure I want to run it over ssl. The middle section of the below .htaccess file switches to https if the request URI begins with /dev and works. The last section of the file works as well but does not work properly with the https redirect. I basically want to be able to type http://www.example.com/dev/some_sub_dir/ and be redirected to https://www.example.com/dev/some_sub_dir/ and prompted for the

Why does IIS 7.5 adds a trailing slash on folders? Can we disable courtesy redirect for a URL Rewrite rule that removes trailing slash?

旧巷老猫 提交于 2019-12-20 17:14:51
问题 IIS does URL cleanup on directories by adding a trailing slash. See this old docs from IIS 6: IIS generates courtesy redirect when folder without trailing slash is requested Why? Is the intent still relevant? Any security implications? How can I disable it to make this work with a URL Rewrite rule "RemoveTrailingSlashRule" When you add a rule under IIS 7.5 with URL Rewrite 2, the rule will not be applied to directories (using IsDirectory) and folders (using IsFolder). See this warning on Add

How to dynamically redirect www-based URLs to non-www URLs with multiple domains in same VirtualHost

岁酱吖の 提交于 2019-12-20 12:41:06
问题 I've got a VirtualHost that looks something like: <VirtualHost *:80> ServerName domain1.com ServerAlias www.domain1.com domain2.com www.domain2.com </VirtualHost> When someone visits www.domain1.com/test, they should be redirected to: domain1.com/test When someone visits www.domain2.com/test, they should be redirected to: domain2.com/test My current RewriteRules are lacking. Edit: Here's what I've got so far: # Rewrite www to non-www RewriteEngine on RewriteCond %{HTTP_HOST} www\.%{HTTP_HOST}

php/symfony2 hiding app.php from the URL

天大地大妈咪最大 提交于 2019-12-20 10:55:07
问题 Consider the following URL : http://www.myurl.fr/accueil. It won't work. However http://www.myrurl.fr/app.php/accueil does work. I got rid of the .htaccess file because I want to use the vhost file and rely on Apache routing. My vhost file is as follow: <VirtualHost my.ip.address> ServerName myurl.fr ServerAlias www.myurl.fr DocumentRoot /var/www/mysite/web DirectoryIndex app.php <Directory "/var/www/mysite/web"> AllowOverride All Allow from All </Directory> <IfModule mod_rewrite.c>

php/symfony2 hiding app.php from the URL

…衆ロ難τιáo~ 提交于 2019-12-20 10:55:06
问题 Consider the following URL : http://www.myurl.fr/accueil. It won't work. However http://www.myrurl.fr/app.php/accueil does work. I got rid of the .htaccess file because I want to use the vhost file and rely on Apache routing. My vhost file is as follow: <VirtualHost my.ip.address> ServerName myurl.fr ServerAlias www.myurl.fr DocumentRoot /var/www/mysite/web DirectoryIndex app.php <Directory "/var/www/mysite/web"> AllowOverride All Allow from All </Directory> <IfModule mod_rewrite.c>

RewriteCond for url with parameters

老子叫甜甜 提交于 2019-12-20 09:37:44
问题 I've got a problem to rewrite an url. I want this : http://www.foo.com/test.php?u=s1&id=12345&img=12 to http://app.foo.com/12345-s1-12.test First parameter u is a string, parameters id and img are integers. I've started with something like that : RewriteCond %{REQUEST_URI} ^/test.php?u=(.*)&id=(.*)&img=(.*)/ [NC] RewriteRule (.*) http://app.foo.com/%2-%1-%3.test [QSA,R=301,L] Thanks :) EDIT : Still doesn't work but i'm close! RewriteCond %{REQUEST_URI} ^/test.php [NC] RewriteCond %{QUERY

How to replace underscores in codeigniter url with dashes?

…衆ロ難τιáo~ 提交于 2019-12-20 08:19:06
问题 I would like to know the simplest solution to changing the underscores of my codeigniter urls to dashes, for seo reasons. My controllers look like: public function request_guide() { ...Load view etc... } So to browse to this page I would have to go to: www.domain.com/request_guide But I want to be more seo friendly and use dashes instead of underscores, like so: www.domain.com/request-guide I am under the impression that codeigniter functions require underscores (might be wrong). In previous

how to write pretty URLs without htaccess file in php

混江龙づ霸主 提交于 2019-12-20 07:44:11
问题 Pretty URLs without htaccess I want to write pretty URL like : http://yousite.com/member/1/ instead of http://yousite.com/index.php?page=member&id=1 But i did with htaccess file and now i want to do this without htaccess file because sometimes you don't have permission to edit htaccess file on server. 回答1: If you have an Apache server and AcceptPathInfo is enabled, then you can just use links like /index.php/nice/looking/url. The "index.php" in the middle of the URL might look a little