url-rewriting

Creating an SEO friendly URL with Htaccess File

一世执手 提交于 2019-12-20 05:46:31
问题 I am trying to setup an SEO friendly redirect, but need to be using my .htaccess in a specific way. Here is what my URLs look like right now: http://www.mywebsite.com/report/index.php?id=38678a80dfea5924 I need to change the URLs so that they look like this: http://www.mywebsite.com/report/38678a80dfea5924 I've read several tutorials about creating SEO friendly URLs, but most of them are referring to making changes to the .htaccess at the root of the domain. Is there any way to do this but

Remove subfolder name from WordPress site using htaccess

ⅰ亾dé卋堺 提交于 2019-12-20 05:12:42
问题 I've moved WordPress into sub-folder named /site but the URL now shows http://www.example.com/site . I want it to show without the /site/ subdirectory. Here's my current .htaccess code RewriteEngine On RewriteBase /site/ RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /site/index.php [L] How do I remove the physical subdirectory from the visible URL? 回答1: I advice you against messing up the contents of the .htaccess file.

Remove subfolder name from WordPress site using htaccess

被刻印的时光 ゝ 提交于 2019-12-20 05:12:10
问题 I've moved WordPress into sub-folder named /site but the URL now shows http://www.example.com/site . I want it to show without the /site/ subdirectory. Here's my current .htaccess code RewriteEngine On RewriteBase /site/ RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /site/index.php [L] How do I remove the physical subdirectory from the visible URL? 回答1: I advice you against messing up the contents of the .htaccess file.

Rewriting url with htaccess when a directory exists

元气小坏坏 提交于 2019-12-20 05:10:27
问题 I'm trying to redirect a dynamic page to a dir, example: url.com/index.php?page=download to url.com/download The rule is very simple: RewriteRule ^download$ /index.php?page=download FULL .HTACCESS RewriteEngine On RewriteBase / RewriteCond %{HTTP_HOST} !^www\.url\.com$ RewriteRule ^(.*) http://url.com/$1 [R=301,L] Redirect 301 /index.php?page=download http://url.com/download RewriteCond %{ENV:REDIRECT_STATUS} 200 RewriteRule .* - [L] RewriteRule ^download$ /index.php?page=download The problem

Remove parameter from URL viac .htaccess

旧巷老猫 提交于 2019-12-20 04:51:58
问题 I need advice how to remove a parameter from the url using. Htcaccess The condition is as follows: redirect url from: http://example.com/?movie=2&ref=nf to: http://example.com/?movie=2 I tried several options but I have not come to nothing Thank you for your ideas / advice. THX. 回答1: Try adding the following to the .htaccess file in the root directory of your site. RewriteEngine on RewriteBase / #If request contains ref param RewriteCond %{THE_REQUEST} \?([^&\ ]+)&ref= [NC] #redirect to URL

Redirect to default language except for /amp/ URLs

…衆ロ難τιáo~ 提交于 2019-12-20 04:38:30
问题 I'm struggling to solve a redirection but without any success. I changed the URLs of my site forcing a default language, before it was site.com/help/ and now it's site.com/en/help/ . Thanks to help from Stack Overflow I made the redirection, but then I faced a new problem with the AMP pages: site.com/amp/help/ are now redirected to site.com/en/amp/help/ while they are supposed to be site.com/amp/en/help/ . Again, thanks to help on this site, I changed the structure of URLs to site.com/en/help

Query string rewriting using .htaccess

£可爱£侵袭症+ 提交于 2019-12-20 04:22:37
问题 i am trying to rewrite a URL for SEO purpose. The old URL is: http://www.domain.net/index.php?p=beer The new URL should be: http://www.domain.net/beer My Code in the .htaccess is: RewriteRule ^([^/\.]+)/?$ index.php?p=$1 Even after hours of research, i have no clue why this is not working :( Here is the complete .htaccess: RewriteEngine on RewriteCond %{HTTP_USER_AGENT} Teoma RewriteRule ^.* - [F] rewritecond %{HTTP_HOST} !^www\.domain\.net$ [NC] rewriterule ^(.*)$ http://www\.domain\.net/$1

Query string rewriting using .htaccess

谁说胖子不能爱 提交于 2019-12-20 04:22:10
问题 i am trying to rewrite a URL for SEO purpose. The old URL is: http://www.domain.net/index.php?p=beer The new URL should be: http://www.domain.net/beer My Code in the .htaccess is: RewriteRule ^([^/\.]+)/?$ index.php?p=$1 Even after hours of research, i have no clue why this is not working :( Here is the complete .htaccess: RewriteEngine on RewriteCond %{HTTP_USER_AGENT} Teoma RewriteRule ^.* - [F] rewritecond %{HTTP_HOST} !^www\.domain\.net$ [NC] rewriterule ^(.*)$ http://www\.domain\.net/$1

Friendly URLs and Query Strings

﹥>﹥吖頭↗ 提交于 2019-12-20 04:16:50
问题 In my project (ASP.NET Web Forms) I want to use Friendly URLs, installed from NuGet. I registered route in global.asax file: Public Shared Sub RegisterRoutes(routes As RouteCollection) routes.MapPageRoute("Route", "default/{id}", "~/default.aspx?id={id}") End Sub With this code, I can use default/123 instead of default?id=123 . I want to add name, assigned to the id, in the url. So I can have url like this: default?123-Firstname-Lastnam. Name is saved in database, in single column. How can I

How can I access the request body in an IIS rewrite provider?

旧街凉风 提交于 2019-12-20 03:52:42
问题 I've written a custom rewrite provider using the IRewriteProvider interface, and installed it in IIS. It's working, but I need to access the content of the request as well as the URL. A newsgroup posting suggests that I should be able to access HttpContext.Current , but in my testing it shows up as null . Is there any way to get access to the request content from a rewrite provider? 回答1: It's most likely null because it never processed any context. If you'd like to modify the url based on