url-rewriting

ASP.NET / IIS7 Url Rewrite maps not working

萝らか妹 提交于 2019-12-07 06:09:14
问题 I've followed the instructions Learn IIS's webpage for adding static redirects with a rewrite map for my asp.net application. The following is the config: <rule name="Redirect rule1 for Information" stopProcessing="true"> <match url=".*" /> <conditions logicalGrouping="MatchAll" trackAllCaptures="false"> <add input="{Information:{REQUEST_URI}}" pattern="(.+)" /> </conditions> <action type="Rewrite" url="{C:1}" appendQueryString="true" /> </rule> And <rewriteMaps> <rewriteMap name="Information

Sitecore - rewrite “ ” to “-” in urls but still allow dashes as legal item names

时光总嘲笑我的痴心妄想 提交于 2019-12-07 06:05:42
问题 I've read a half dozen guides on rewriting spaces to something more friendly in Sitecore, but all of them rely on Sitecore's <encodeNameReplacements/> element which also reverses the replacement requiring "-" to be an illegal character for names. The problem with this is that the url of our application has a "-" in the hostname. Sitecore rewrites this resulting in a 404. Does anyone have ideas on how to do this url rewriting in Sitecore without relying on <encodeNameReplacements and still

PHP routing for friendly URLs help

自古美人都是妖i 提交于 2019-12-07 05:29:43
问题 I am building a website that runs all of the code trough index.php. For example index.php?controller=something&id=01234 . I want to use PHP to create friendly URLs, so I do this: $request = str_replace('/root/', '', $_SERVER['REQUEST_URI']); $params = explode('/', $request); $controllers = array('first_c', 'second_c', 'third_c'); if (in_array($params[0], $controllers)) { include($params[0]); // just to give an example } Then with a mod_rewrite rule RewriteRule ^.*$ ./index.php I redirect

Force non-WWW but force https across all of wordpress & the entire domain

谁说我不能喝 提交于 2019-12-07 04:54:42
问题 I am having some issues with multiple wordpress installations and .htaccess rewrite rules, mainly for forcing https but also removing www. from any domain. Domains/Subdomains: Wordpress 1: examplewebsite.com ( /home/hostingacc/public_html/ ) Wordpress 2: test.examplewebsite.com ( /home/hostingacc/public_html/test/ ) Wordpress 3: moretests.examplewebsite.com ( /home/hostingacc/public_html/moretests ) .htaccess Rewrites I've tried to use several rewrite rules that I've found across the internet

URL Rewrite - Remove .html extension

穿精又带淫゛_ 提交于 2019-12-07 04:01:15
问题 So the idea is to remove the .html extension from each page like so... www.website.com/File.html > www.website.com/File www.website.com/Folder/File.html > www.website.com/Folder/File Now I've managed to do this using a URL Rewrite, but it means having to write a rewrite for each page, which is time consuming, not efficient and impractical say if the website is more than 20 pages. Is there a way to do this by writing just one or two rewrites in the web.config? 回答1: This solution worked for me

Url rewriting with asp.net. is there a configuration needed?

笑着哭i 提交于 2019-12-07 03:13:14
问题 I'm trying to enable rewrited urls in my project. it's very good described in this post: urlrewriting by scottgu It works very well when im running it on localhost, but as soon as i upload it to my host (.net 3.5), it doesn't work! i always get redirected to a 404 page! Is there a configuration needed to enable this? as scottgu says no, but i don't find out why it's not working... thanks // UPDATE 2.09.2010 Is there actually a way to enable routing or rewriting without having iis7 or the

How to rewrite if file not found using NGINX

拟墨画扇 提交于 2019-12-07 02:57:50
问题 I'm using NGINX On Ubuntu server. I have this vhost: server { listen 80; server_name *.example.com; root /home/nginx/vhosts/example.com/web; location / { index index.php; } location ~ \.php$ { fastcgi_pass 127.0.0.1:9001; fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name; include /etc/nginx/fastcgi_params; } } I have to add a rule... If the file/dir IS NOT FOUND use index.php How could I change my server {} directive? Thank you! 回答1: You can use the try_files directive: try

Dynamic URL Rewriting in ASP.net C#

孤街浪徒 提交于 2019-12-07 02:08:25
I am looking to dynamically rewrite urls in asp.net C#. I want to read the page name from the database and process the request. For example PAGENAME: Home .NETPAGE: Default.aspx?page=1 I think it is possible, can someone point me to right direction. M4N Have a look at this question: ASP.NET - Url Rewriting vs. Routing 来源: https://stackoverflow.com/questions/3663211/dynamic-url-rewriting-in-asp-net-c-sharp

ASP.Net URL Encoding

爱⌒轻易说出口 提交于 2019-12-07 01:40:38
问题 I am implementing URL rewriting in ASP.net and my URLs are causing me a world of problems. The URL is generated from a database of departments & categories. I want employees to be able to add items to the database with whatever special characters are appropriate without it breaking the site. I am encoding the data before I construct the URLs. There are several problems... IIS decodes the URL before it reaches .net making it impossible to properly parse anything with a "/" in it. ASP.net gets

How to create Virtual Host from Apache .htaccess?

非 Y 不嫁゛ 提交于 2019-12-07 00:31:48
问题 I am using Apache Friends XAMPP in Windows (Local Server). I setup the virtual host in httpd-vhosts.conf in an Apache configuration directory like this NameVirtualHost *:80 <VirtualHost *:80> ServerName test.example.com DocumentRoot "E:\xampp\htdocs\example" </VirtualHost> This works fine when I browse the URL http://test.example.com Is it possible to create virtual host from Apache .htaccess dynamically? 回答1: The context for VirtualHost has to be server config . See the Apache docs. This