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.

Filter by
Sorted by
Tagged with
0
votes
1answer
4 views

How can i rewrite url to redirect my url like this by .htaccess?

My current url is example.com/example/{dynamic_id}/{dynamic_name}/static/1.html I want to redirect it to this, example.com/{dynamic_name}/example/{dynamic_id}/static/1.html i tried but failed.
1
vote
1answer
36 views

Url changing with htaccess

I have a web presentation with some typical url adresses. Now I need to add a rewriterule for a different languages, examples: domain/club -> do not change domain/club/path -> do not change ...
1
vote
0answers
28 views

Modify rewrite rule to handle four ids rather than just one

I have rewrite rule which gives id from link to script and it works perfectly: RewriteRule ^index/viewproduct/id/(\d+)$ produkty/index.php?id=$1 [L] I need one more RewriteRule to handle URLS like: ...
1
vote
1answer
29 views

.htaccess Rewrite Wordpress Subdirectory without breaking other subdirectories

So I have WordPress installed in /wp/ but I want all WordPress URLs to be rewritten to appear in the root directory. I currently have this working (see below) but I want to change my .htaccess so it ...
1
vote
0answers
16 views

Can a reverse-proxied Facebook in an IFRAME access the other logged-in Facebook's in other windows and IFRAMEs?

We have set up a reverse proxy to Facebook. We wound up another subdomain on our server and pointed it at https://www.facebook.com using the following web.config. (Redacted slightly for security's ...
1
vote
2answers
34 views

Using two domain names in a single folder

I have inherited an English/French static web site. The original developer created it so all the html files are in the root directory of the English domain and added "-fr" to the French file ...
1
vote
1answer
28 views

Rewrite URL with ID to one file using .htaccess

I have "home" directory as: /var/www/page I need redirect: /var/www/page/index/product/id/9098890 Where 9098890 is the id of product. to one file: /var/www/page/script/index.php I want ...
1
vote
1answer
36 views

Will a .com SSL certificate cover a redirecting .com.ar domain?

we have a website with 2 different domains: www.example.com or example.com and www.example.com.ar or example.com.ar I want all requests redirected to www.example.com. I know I have to create two ...
2
votes
1answer
54 views

How can I limit .htaccess to current directory scope only?

I have something like this: Options -Indexes RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ /index.php?path=$1 [NC,L,QSA] Order deny,allow ...
1
vote
1answer
22 views

Can I have separate url in internal navigation of website and Sitemap?

I have not so SEO friendly url structure in my internal navigation of website(some technical challenges) but marked each of the page with SEO friendly canonical(through CMS) and these canonicals are ...
1
vote
2answers
38 views

Will /blog/ at the start of the URL path for my WordPress articles help SEO?

I have a WordPress website for a business. And they have many pages, Custom Posts, etc. And they do have a Blog also. At present their blog urls are like this: Main page for blog: example.com/blog ...
0
votes
0answers
36 views

How to IIS Rewrite when the URL contains a bookmark (#)?

I have a URL that's been inserted into a multitude of online courses, containing multiple QueryString parameters and a hashtag bookmark. Unfortunately, whoever inserted them also added some spaces, ...
1
vote
1answer
32 views

how fix rewrite rule conflict

I am using following rewrite rule and its working fine : 1) RewriteRule ^([^/]*)/?([^/]*)/?([^/]*)/$ estates1.php?pageNum_Clusterb=$3&estname=$1&location=$2 [L] but when add second code in ...
1
vote
2answers
32 views

How do irrelevant parts of restructured URL affect SEO?

I'm new to SEO and not sure how exactly google crawler works If I use the following format for URL: example.com/category/id/name The content of the page is loaded by only the id part, the other ...
1
vote
0answers
14 views

SEO Rewrite , URI Without .php Extension To file [duplicate]

I have website with this output Link : https://domain1.net/estates.php?estname=XXXX&location=YYYYY I want change it to : https://domain1.net/XXXXX/YYYYY I try it with following rewrite rule : ...
0
votes
0answers
11 views

Nginx rewrite add symbol after word

I have link for widget in web server nginx I need to put slash after word "widget" /folder1/folder2/folder3/foldereverytimeischanging/someID.widget?1234567890 must be /folder1/folder2/folder3/...
3
votes
1answer
48 views

301 redirect rewrite query string in .htaccess [duplicate]

I am trying to perform a 301 redirect in .htaccess and I need to remove the query string ?view=full. Here is what I have that is not working: RewriteRule ^/contact/?view=full$ /contact/ [R=301,L] I ...
0
votes
0answers
18 views

Which URL is best [duplicate]

We are in the process of creating landing pages whose contents will be living in the server whose directory houses mylove.example.com. The URL will be mylove.example.com but for marketing purposes, ...
3
votes
0answers
25 views

NGINX configuration for the same folder protection rewrites in each of thousands of subdirectories

The following code allows me to protect a specific folder with the membership software we're using. The problem is if we have 1,000 folders we need to protect, we need to copy/paste this same code for ...
0
votes
1answer
13 views

URL Rewrite - Does order of directories matter to search engines?

So a pretty straight forward question here. Should the directory structure created from url parameters such as: /color-brown/shape-square/material-wood/ remain consistent? Does it matter if you also ...
2
votes
1answer
632 views

mod-rewrite - sending any URL with “.php/” to 404

I have a substantial number of rewrite rules in place for a variety of reasons such as: disallow indexes, set custom error pages, force non-www, https, strip trailing slash, redirect index.html or....
1
vote
0answers
15 views

How to use the same base url prefix for category and product pages in Woocommerce?

I checked out this article https://docs.woocommerce.com/document/removing-product-product-category-or-shop-from-the-urls/ which explains that it is not good to remove the product and category bases ...
2
votes
1answer
39 views

Can I rewrite to a redirected URL using .htaccess file?

I have a page A. I want to have a page B which is served as a rewrite of page A using .htaccess. Is it possible to redirect page A to page B from .htaccess or is it going to go into an endless loop?
0
votes
0answers
21 views

Does having the trailing slashes after the end of the urls affect the rank? [duplicate]

Recently I have set up trailing slashes into all my urls. I'm redirecting all the plain urls to the slash one, So I wanna know if sudden change have an affect over the Google ranking. Will Google try ...
-1
votes
1answer
19 views

Aesthetic URL problem: Website from server02 should look like its on a subdirectory of the main site from server01

www.example.com is on server01 with IP address 192.0.2.123 abc.example.com is on server02 with IP address 192.0.2.21 I actually do not want the subdomain abc. Ideally I want it at www.example.com/...
3
votes
2answers
59 views

Adding IDs to urls to open up namespace - SEO considerations?

I'm working with a site that has millions of pages along the lines of: domain.com/entity/John_Smith domain.com/entity/Google domain.com/entity/HTML One of the problems is that particularly for ...
2
votes
1answer
50 views

.htaccess - RewriteRule for 404 and query

I am very new to this stuff. I have a website with these RewriteCond/RewriteRule directives. Options All -Indexes RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME}...
2
votes
1answer
50 views

How do I create clean URLs such that what is currently in a parameter goes in the path?

My url is http://localhost/store/product-detail.php?p=prod%name%test i want it to look like this http://localhost/store/prod-name-test or something like this as other stores do http://localhost/store/...
1
vote
2answers
176 views

Does Google index page URLs with languages parameters as a different page?

If I implement multilingual access to the resource through the parameter: 1) https://example.com/en/article-1 2) https://example.com/article-1?l=en So, does Google index both of them as a single ...
2
votes
1answer
52 views

htaccess rewriterule not working for old urls for site rebuild

I am struggling to get the rewrite rules working in .htaccess for search links on a property rental website I am working on. The old links are like this: example.com/index.php?proptype=Villa&...
1
vote
1answer
38 views

URL Character Counting - Where to start counting?

I'm rewriting URLs for a website, I know it could affect SEO, but I've no choice but to rewrite them, and 301 redirect the old ones to their new URLs. I want to try to keep the new URLs short and to ...
2
votes
1answer
368 views

How to configure .htaccess to rewrite all requests into a folder, except a list of exceptions

I have an established website with some legacy folders I would like to keep. https://example.com/.well-known/ https://example.com/Music/ https://example.com/Rutabagas/ I've also installed ...
4
votes
1answer
65 views

How would you implement redirects for domain canonicalization, no-www, and HTTPS for IIS 7.5

For the moment I'm stuck with an IIS-server, unfortunately not my best subject (I'm much better w. Apache). We have a site on a Win 2008 R2 Server with IIS 7.5. It's an old site and we are working on ...
2
votes
1answer
54 views

How to rewrite using .htacess when there is a ? (question mark) at the beginning of the URL?

Many JS functions on my site are sending Ajax request to /?something=3213214 but I need to redirect them to /something=3213214 When I do: RewriteRule ^test/(.*) /$1 [R] It does redirect /test/...
2
votes
1answer
33 views

I can't run 2 or more url rewriting rules at once

I was trying to shorten the URL more, but I was removing .php file extension from the URLs using URL rewriting too. I can't run both at the same time. Removing the extensions and trying to shorten ...
0
votes
0answers
34 views

Some links are indexable and some others are not when they are all created equal, why?

I'm trying to create a sitemap. I'm using the Screaming Frog software, but I think that this can be achieved in different ways with other software as well. My links are generated with different ...
1
vote
1answer
260 views

Using IIS URL Rewrite module instead of Global.asax for complex redirect rules

We have a legacy ASP.NET website in which complex redirect rules are coded in Global.asax. Actually this logic processes requests with several optional or variable parts like {http|https}://[www.]...
2
votes
1answer
44 views

Does a new permanent rewrite rule supersede old permanent rewrite rule?

Ages ago we included a redirect in web.config to ensure that pages would rewrite to http://www.example.com/ if the user input, say, www.example.comor variants of it. Recently we changed the site so ...
1
vote
1answer
286 views

How to redirect all requests to HTTPS with SEO friendly URL using Apache?

First of all, I would like to leave remove www and redirect all request to HTTPS like this: RewriteCond %{HTTPS} off [OR] RewriteCond %{HTTP_HOST} ^www\. [NC] RewriteCond %{HTTP_HOST} ^(?:www\.)?(.+)$...
0
votes
1answer
42 views

Rewrite rule messes up direct links to directories

I have a very simple rewrite rule which does the job: allows link domain.com/index.php?page=NAME to be displayed as domain.com/NAME. The problem is when I try to give direct link to the image www....
2
votes
1answer
154 views

Rewrite rule to give 410 Gone for a specific URL doesn't work

I'm French. A week ago, my website was hacked with the old version (http). The hack created 404 spams and I want to ensure they have "410 Gone" status. My problem on the site is: https://www.example....
0
votes
1answer
32 views

How to change the URL of a wordpress website?

By default, my URL was set to example.com/wp/wp-admin instead of the example.com/wp-admin that I used to remember. Also my website's contents show on example.com/wp rather than example.com. How do I ...
1
vote
1answer
366 views

.htaccess rewrite stops working for javascript files after moving server

We recently moved an old PHP Project from a server using httpd to our regular prod. servers running apache2. In this project we have some reroute rules that map requests either to our index.php file ...
2
votes
1answer
43 views

Do search engines crawl links with query strings?

If I were to have a url like https://example.com/books, that contained several links to urls such as: https://example.com/books?id=foo https://example.com/books?id=bar https://example.com/books?id=...
1
vote
0answers
33 views

Apache VHost rewrite rule not working as it should

I have setup an Apache server inside my domain and have been creating VirtualHost in the httpd-vhosts.conf file. Up until now this has worked without issue, I have a few DNS entries externally that ...
2
votes
0answers
209 views

Is it safe to do a htaccess rewrite for mobile traffic to amp pages?

I have a requirement to use the same URL for both desktop and mobile devices. On mobile, I want to serve amp HTML while on the desktop I want to render normal HTML. In such case is it safe (from SEO ...
1
vote
0answers
53 views

Password protect a website only if it is the dev site [closed]

I am trying to password protect a website only if it is the dev site using .htaccess and .htpasswd I am using Apache 2.4.29 on Ubuntu 18.04 Here is what I have in the .htaccess file <If "%{...
2
votes
1answer
693 views

Removing PHP Extension in sub directory

I use the following rewrite rule to remove the .php extension from my page urls: RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^([^\.]+)$ $1.php [NC,L] This works great in the root directory of my ...
2
votes
1answer
53 views

Order of RewriteRules is affecting the result

This is my current .htaccess: RewriteEngine On RewriteRule ^([\w-]+)/([a-z0-9]+)/([a-z-0-9]+)$ index.php?p=$1&bay=$2&map=$3 [L] RewriteRule ^test/([\w-]+)/(\d+)$ index.php?page=$1&tab=$2 [...
2
votes
1answer
72 views

Apache rewrite to www. unless it is a dev domain

Here is my current rewrite code in my htaccess file: RewriteCond %{HTTPS} off [OR] RewriteCond %{HTTP_HOST} !^www\. [NC] RewriteCond %{HTTP_HOST} ^(?:www\.)?(.+)$ [NC] RewriteRule ^ https://www.%1%{...

1
2 3 4 5
10