url-rewriting

.htaccess redirect only if GET parameter exists

◇◆丶佛笑我妖孽 提交于 2019-12-22 09:43:51
问题 I have a client with an old website without 'pretty' URLs. So currently it looks like this: http://www.domain.com/?w=42&a=5&b=3 The parameter values are numbers only. Now they want to move the old site to a subdomain and main (www) domain would be home to a new website (WP with SEO friendly URLs). Now what I would like to do is redirect all requests that come to the /?w=<num> (and ONLY those) to sub.domain.com/?w=<num> , so that existing links (mostly from Google) get redirected to the

mod_rewrite: Check for Custom query string in URL?

久未见 提交于 2019-12-22 09:26:36
问题 I'm trying to use URL rewrite in my new project. But I also need to allow custom query sting in URL. I just want to know how to write rewrite rule for this URL http://www.mysite.com/edit/123/?q1=value1&q2=value2 to become this http://www.mysite.com/index.php?action=edit&id=123&q1=value1&q2=value2 The custom query string should be allow unlimited. Millions of Thanks... 回答1: Simply do your rule as any other rule and add the QSA modifier (Query String Append) at the end. RewriteEngine On

Using .htaccess to reroute all requests through index.php EXCEPT a certain set of requests

人盡茶涼 提交于 2019-12-22 09:13:12
问题 So I just inherited a site. The first thing I want to do is build a nice little standard, easy-peezy, CMS that allows for creating a page with any URL (for example: whatever.html). Therefore, if user hits example.com/whatever.html, it should get any db info for whatever.html and display it. This is run of the mill stuff. My problem is that there are quite a few pages on the site (all listed in the .htaccess) that need to continue to be accessible. For instance, /Promotions is linked to

URL rewriting in .NET 4?

情到浓时终转凉″ 提交于 2019-12-22 08:33:49
问题 I heard that in Visual Studio 2010 give built-in functionality for URL rewriting using its URL Routing engine. I did URL rewriting in earlier version of visual studio by using plug in like intelligencia urlrewrite. Can any one explain me or guide me to understand that? Want to implement dynamic and custom url rewriting in my website. 回答1: Are you refering to .net 4.0 URL Routing ? URL routing was a capability we first introduced with ASP.NET 3.5 SP1, and which is already used within ASP.NET

.htaccess redirect directory to a single page

為{幸葍}努か 提交于 2019-12-22 08:16:59
问题 I want to redirect all pages from the .com/blog directory to the .com/error directory. I have searched the web, and found loads of different ways of doing it, but I want it to redirect to a single page. All the things I have tried redirect to the same file name, but in different directory. For example, .com/blog/index.nonexisting redirects to .com/error/index.nonexisting . I would like all files in the first directory to redirect to a certain file, so if you go to .com/blog/whatever.php it

How to remove a URL's trailing slash in a Rails app? (in a SEO view)

China☆狼群 提交于 2019-12-22 07:47:12
问题 In order to avoid content duplication, I would like to avoid the pages of my site being accessible by several URLs (with or without trailing slash). Currently, the URLs catalog/product/1 and catalog/product/1/ lead to the same page. My goal is that the second URL redirect to the first (redirection 301, of course). None page of my site should be accessible with a trailing slash, except my home page / obviously. What is the best way to do this? Using .htaccess or routes.rb? How would you do

How to remove a URL's trailing slash in a Rails app? (in a SEO view)

大城市里の小女人 提交于 2019-12-22 07:47:07
问题 In order to avoid content duplication, I would like to avoid the pages of my site being accessible by several URLs (with or without trailing slash). Currently, the URLs catalog/product/1 and catalog/product/1/ lead to the same page. My goal is that the second URL redirect to the first (redirection 301, of course). None page of my site should be accessible with a trailing slash, except my home page / obviously. What is the best way to do this? Using .htaccess or routes.rb? How would you do

Is it good idea to use URL names with special characters? [closed]

走远了吗. 提交于 2019-12-22 06:56:46
问题 Closed . This question is opinion-based. It is not currently accepting answers. Want to improve this question? Update the question so it can be answered with facts and citations by editing this post. Closed 5 years ago . Is it good SEO to have URL's (page names) with non-english characters like Chinese names in URL's? 回答1: from a SEO perspective GENERAL URL RULES: all URLs on an a webproperty must be according to these rules (listed in priority) 1) unique (1 URL == 1 ressource) 2) permanent

Add url extensions to Laravel routes

删除回忆录丶 提交于 2019-12-22 05:43:14
问题 Is it possible to add an extension to laravel routes like so? http://www.mywebsite.com/members/login.html and another page with a different extension http://www.mywebsite.com/contactus.htm I am transitioning an old website into laravel but the owner doesn't want to change the URL for SEO purposes. 回答1: Yes, this is certainly possible and very straightforward to do with Laravel. routes.php: Route::get('members/login.html', function() { return View::make('members.login'); } ); Then you need to

IIS URL Rewrite Rules

大憨熊 提交于 2019-12-22 05:41:00
问题 I have a AngularJS application that utilizes URL Rewriting for linking. My rewrite rule looks like : <rewrite> <rules> <rule name="MainRule" stopProcessing="true"> <match url=".*" /> <conditions logicalGrouping="MatchAll"> <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" /> <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" /> <add input="{REQUEST_FILENAME}" matchType="Pattern" pattern="^api/(.*)" negate="false" /> </conditions> <action type="Rewrite" url=