Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [url-rewriting]

A URL rewrite engine is software that modifies a web URL's appearance (URL rewriting). Rewritten URLs (sometimes known as short, fancy URLs, or search engine friendly - SEF) are used to provide shorter and more relevant-looking links to web pages. The technique adds a degree of separation between the files used to generate a web page and the URL that is presented to the world.

1
vote
3answers
82 views

Will shortening a URL hurt my SEO?

Will I mess up my SEO if I remove a part of my URL, even if it still takes you to the same page? An example is: example.com/services/nc/clt/charlotte-nc/... And I want to take out the "services" ...
2
votes
2answers
4k views

How to remove subdirectory folders from the url using htaccess

I am trying to remove the sub-folders from my site URL. Below is the structure of my folders. I am not sure where to place my .htaccess file and what to have written in it: mysiteroot ...
1
vote
0answers
219 views

IIS showing 404 error for CakePHP routing prefixes for instance located in subfolder

I have this Single Page Application built using AngularJS that resides in the document root. The SPA communicates with an API built using CakePHP 3.5.x. The CakePHP instance resides in a folder named ...
0
votes
0answers
43 views

Nginx rewrite for wp-includes works but not the one for content/uploads

I want to perform a few rewrites: this actually works: rewrite ^/includes/(.*) /wordpress/wp-includes/$1?putyo_happybits=administrator last; and I get this: http://everhide.wordpress.dev/includes/...
2
votes
1answer
80 views

Enabling Multiviews is how you make a web server able to open links with missing extensions?

I'm in the process of switching web hosts. My old host was of the beginner-friendly 'kid gloves' variety. I had less control, but it took care of a lot of things behind the scenes. My new web host ...
3
votes
1answer
2k views

Nginx: set Content-Type by URI problem

I'm setting up small personal file hosting, I made a backend to store uploaded files by their hash directly on the HDD like /f/ab/cd/ef012345678..., but without file extensions and generate an URI ...
2
votes
1answer
39 views

Asked to authenticated WebDav twice when connecting to HTTPS

I'm having the problem of double authentification on my Apache server like he has: Properly Force SSL with .htaccess But I want to do this via the conf files. He says he knows how to do it via conf ...
2
votes
0answers
85 views

.htaccess to show a page from the main site on another domain

I have 2 x domain names https://www.example.com - This is my main site. http://www.example-liverpool.com This is my Liverpool sub website example.com/liverpool I've presently got URL forwarding ...
0
votes
2answers
800 views

Apache .htaccess: Is it possible to write an if condition for a cookie value check?

I want to write an if condition in an .htaccess file to check whether a cookie value is set. Example code: <If "%{HTTP_COOKIE} == 'cookiename and value'"> ... </If>
1
vote
2answers
37 views

Rename translated documents into ending language initials

I am building a web app and trying to add two languages to the website. So I will make the same documents ending in -gr. Some examples of the files look like this: English Language paths: www....
0
votes
0answers
6 views

How to properly use keywords with get urls [duplicate]

I have a website with a list of products for which I am using $_GET in php. This way i dynamically generate the page content based on the id of the category in the url. I have a category and then a ...
1
vote
1answer
77 views

What is a rewrite rule to add a prefix directory for a specific set of pages (dozens)

I have some pages on a Wordrpress site as www.example.com/title-of-the-page For my SEO activities I would like to add a prefix to those pages. They will be www.example.com/name-of-the-prefix/title-of-...
1
vote
1answer
79 views

Use .htaccess to make pretty URLs that expand abbreviation codes

Yes, I know, there are tons of questions like this, but I can't find one which solves my problem so at cost of receiving downvotes I'm going to ask this again. Even a duplicate link may help me. This ...
3
votes
1answer
79 views

Is it a Good Practice to move a blog from HTTP to HTTPS?

I have an e-commerce that is on https://www.example.com/, and I have a blog on the same URL, and it is on http://www.example.com/myblog/. Now, according to Google's guidelines, they are giving more ...
2
votes
1answer
58 views

Redirect old url with several dirs to first level

I've a lot of url with same estructure /blog/<category>/item/<slug-article> Such /blog/administracion-sistemas-unix/item/named-run-gigante I like create a rule to move a first level ...
4
votes
0answers
223 views

Ubuntu 14.04 can't enable .htaccess

I'm developing a website local and just switched from Windows to Ubuntu 16.04 - Sadly my .htaccess doesn't seems to work since rewrite rules don't apply and sources can't be found. I activated: sudo ...
2
votes
1answer
2k views

(nginx rewrite) add word on dynamic URL ending | word is repeated multiple in URL

I'm really confused by the Nginx rewrite rules. I have searched and found a lot of threads for rewrite rules but I don't get the required result... I have this form of a link: http://example.com/...
6
votes
1answer
2k views

rewrite url - remove trailing / if any and add .php

I have a simple question, yet I've found no posts that answer my question. I need an htaccess file that rewrites the urls so that it removes the ending / if any, and adds .php no matter what the ...
2
votes
1answer
729 views

How can I mask URLs with subdirectories to display the same URL?

We have a website called example.com I want these paths and their subdirectories: example.com/vip/members/alice/watch example.com/vip/members/alice/bag to be permanently displayed to visitors as: ...
-4
votes
1answer
83 views

display facebook.com in browser adress bar but display another site content in body

I want to display example: https://www.facebook.com in my members browser address bar but display another site content in my webpage body. I want to use .htaccess file. RewriteEngine on RewriteCond %...
1
vote
1answer
161 views

How to set up URL masking on gh-pages and GoDaddy

I have a domain that currently redirects www.example.com to example.com. It is hosted on gh-pages. However, there is a resource link I access from index.html called privacy.html via <a href=...
1
vote
1answer
31 views

How to redirect old parameter based content without jeopardizing SEO

We have a large scale ecommerce site that has pretty high PageRank and tops google results in a few keywords, the current issue is that we have revamped our search which now uses SEO friendly urls to ...
1
vote
0answers
122 views

Create unique IDs between URL with nginx [closed]

I searched and tried nearly two weeks but don't get any useful result, so I'm trying my luck here before I get crazy: Every existing domain should get an unique ID right after the domain. The ID ...
2
votes
2answers
328 views

which component handle php's GET parameters in a URL

In a webserver, which component handles the translation of URL parameters to the $_GET global variable? Is that a module in PHP engine, or a module of the web server (Apache, Nginx)? I'm asking ...
0
votes
0answers
28 views

What's the effect on SEO if you can change part of a URL and still receive the same page?

I have a domain for my webshop, and for all the category pages the structure is like this: www.domain.com/category-NAME/category-NUMBER. See the screenshot below for an example. I can change the ...
5
votes
1answer
3k views

How to bulk redirect URLs and replace one path segment?

I have several URLs in a WordPress website I would like to rewrite and then make a 301 redirect. URLs are of the form www.example.com/prodotto/something-after These URLs should be changed to www....
1
vote
1answer
377 views

Rewrite URL with multiple queries

This article describes how to direct incoming traffic coming from "fake" URLs of this type: http://www.example.com/seo-sample/article-install-apache-on-linux.php to a PHP file that "really" uses ...
3
votes
1answer
1k views

Set Alias path using .htaccess

I have a path like this http://host.ip/nl/producten-en-diensten/abonnementen-met-gsm which will retrieve the correct content and I also want to receive the same content when I access the below URL ...
3
votes
1answer
129 views

Is this literal or code in the .htaccess file?

Background: Recently, a business acquaintance contacted me because of strange behavior on his website. As may be expected, I found that the site was compromised. One of the signs of the compromise ...
6
votes
2answers
4k views

Have Apache show 404 at missing page URL instead of redirecting to error page URL

Assuming non-existent-page.html does not exist, and the user is trying to access that page and triggered a 404 error. Can i show the requested page URL: http://www.example.com/non-existent-page.html ...
1
vote
1answer
79 views

Modify existing htaccess rewrites to not match particular URLs

Trying to rewrite only particular URL's, for example:- (1) I want to rewrite:- http://www.example.com/keyword-1 http://www.example.com/keyword-1/sub-keyword http://www.example.com/keyword-1/?p=50 (...
1
vote
2answers
720 views

Most seamless way to direct around port 80 and autoredirect to https with Apache

I'm working with a home server and my ISP blocks port 80. I have DD-WRT set up on my router so that I can redirect other open ports (like 443 and 8080) to the server. I also have dynamic DNS set up on ...
2
votes
0answers
538 views

Nginx request map and redirect have no effect

I want to rewrite/return request to new one I have: map map $request $new_request { include url_rmap.conf; } file url_rmap.conf # here i have tried all variations $scheme://d.dom https://...
2
votes
1answer
1k views

How to remove .jsp extension and replace with forward Slash in htaccess?

I want to remove the .jsp extension from my URL and replace it with a forward slash eg. example.com/xyz.jsp to example.com/xyz/ and example.com/xyz.jsp?ab=12 to example.com/xyz/?ab=12. I used: ...
3
votes
1answer
312 views

Htaccess redirect a page with a query string hosted on a temporary IP address?

I have a site that was temporarily set up as 111.222.333.444/~mysite because the real URL was not ready. 111.222.333.444/~mysite/?page_id=123 was a valid page on that site. My site is live now. I no ...
1
vote
1answer
52 views

non-www URL goes to www-homepage instead of that particular page

Let's say my domain is www.example.com. if I type in example.com it goes to www.example.com - which is fine. But the problem is if I type in example.com/jamie/ it still goes to www.example.com - the ...
4
votes
1answer
75 views

Why does apache redirect to www without RewriteRule

So I have a webserver running on Apache, with a few virtual hosts. I want to default to https and hence I have a rewrite rule. <VirtualHost *:80> ServerName example.com ...
3
votes
2answers
631 views

Using an alias on my domain. How do I tell Google that I want it to only index the alias to avoid duplicate content?

I am starting a music blog at www.domain1.com. That URL is an alias shared with www.domain2.com which is just a domain I happen to have hosting with but is unused. In the future I may want to develop ...
1
vote
1answer
6k views

.htaccess redirect without changing url in users' address bar

My website redirects to /temp when visiting the root, I'd like it to appear as the root, without the /temp in the URL address bar. I have a simple .htaccess: Options +FollowSymlinks RewriteEngine On ...
0
votes
1answer
103 views

Multiple Websites with Multiple Sitemaps under single IIS Endpoint

We have multiple websites with different domains under single IIS endpoint. Each website has its own sitemap - sitemap1.xml and sitemap2.xml. Can we implement rewrite rules so that www.example1.com/...
3
votes
1answer
916 views

Rewrite and hide page ID from URL

I am working with the following on a football website and when a user clicks an event they get the following URL format: /live/1/event-name.html Currently the number in the URL represents the ID ...
1
vote
2answers
3k views

Force IIS to reload URL Rewrite Rules

I did a change to the URL Rewrite rules to prevent hotlinking to pictures and uploaded the Rules.Config to my site. However, it didn't work so I rolled the change back and reload web.config. ...
6
votes
1answer
265 views

Use of no-index-meta-tag on pretty URLs?

By now I am fighting through the world of SEO and run into a problem, I think. Let's say I have a page like www.example.com/i-am-a-pretty-url, which is re-written by .htaccess from i-am-ugly-url.php ...
4
votes
3answers
586 views

Which is more SEO friendly, redirect or rewrite?

On Apache 2.4, which is better for multiple migrated URLs in terms of SEO, 301 redirect or rewrite? I have ~50 URLs.
1
vote
1answer
2k views

Where is the URL Rewrite options in IIS 6.2?

I am trying to set a replica of an existing (production!) web site of my new employer on my local machine. By replica I mean: "as close of possible" in terms of versions (IIS, PHP, MySQL, WordPress, ...
3
votes
3answers
871 views

Redirect $.html to $/ mod_rewrite rule clash

I have already remapped URL's from for example /sub/test/ to test.html but I also want to redirect /sub/test.html to /sub/test/ but here seems to be a clash between the rules. .htaccess files is in ...
5
votes
1answer
595 views

What might be causing my site's pages to load more slowly in these IIS Rewrite Module rules?

I have the following IIS rewrite rules that work exactly as I wish on both my development and live servers within an Orchard CMS website, though when enabled, seriously slow the site's page loads. ...
1
vote
1answer
72 views

Best SEO practice to redirect wrong URLs with mixed langage in it

a bad plugin generated some wrong path that returned 404 errors when switching language on Joomla website. The plugin problem is solved (I removed it), now I just want to redirect this few errors to ...
3
votes
2answers
61 views

Is a real http to htttps rewrite possible or is this always going to be a redirect?

I noticed that there are some articles on the Internet that talk about using the apache mod_rewrite module to rewrite a client to server http connection to https. But rewrite does all the changes ...
2
votes
0answers
43 views

httpcontext.rewritepath -> duplicate meta tag

We have a webpage that handle all car manufacturers. Page is called vehicule.aspx. We have a rewrite method for SEO purpose. We gave all manufacturers a unique URL that redirects to the above page. ...